n

Python Classroom image

Anil  Bist / Professional / Web Technology

 
To post your Question Join Classroom
 
Question No  (5 of 31)
First 1 I 2 I 3 I 4 I 5 I 6 I 7 I 8 I 9 Last
 
Question:-
How can you randomize the items of a list in place in Python?
 
Answer:-
['Flying', 'Keep', 'Blue', 'High', 'The', 'Flag']

Consider the example shown below:

1

2

3

4

from random import shuffle

x = ['Keep', 'The', 'Blue', 'Flag', 'Flying', 'High']

shuffle(x)

print(x)

The output of the following code is as below.

  
 
 
 
image
Anil  Bist

Skills    Python

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,
Description:-

in 2006, i Join a web development company in Bangalore and start work on "Ruby on Rail" this is my first web development framework and we worked in this framework and develop four to five project after some time , I moved to JEE/Sturst frame work,

After some time i decided that now times come and I have to go on in my own way and I started a company name is "Soarlogic&q
Explore

 

  Students (3)

Ask 
image
Vikash
Ask 
image
Anil
Ask 
image
Anil
 
 

Recommended Classes

Prashant Nigam
Student
image Anil Bist
in 2006, i Join a web development company in Bangalore and start work on "Ruby on Rail"...
Professional
image sonali uniyal
I am persuing MBA ,marketing management . And recently work at "Soarlogic Infomati...
Professional