>>> import random
>>> x = [1, 2, 3, 4, 3, 4]
>>> random.shuffle(x)
>>> x
[4, 4, 3, 1, 2, 3]
>>> random.shuffle(x)
>>> x
[3, 4, 2, 1, 3, 4]
More Related Contents:
- Random string generation with upper case letters and digits
- How to generate random strings in Python?
- find all possible combinations of letters in a string in python [duplicate]
- How do I print curly-brace characters in a string while using .format?
- Check if multiple strings exist in another string
- How do I create a list of random numbers without duplicates?
- How to use string.replace() in python 3.x
- Converting integer to string in Python
- Create nice column output in python
- Aren’t Python strings immutable? Then why does a + ” ” + b work?
- Find the nth occurrence of substring in a string
- How can I check if a string represents an int, without using try/except?
- String to list in Python
- Removing a list of characters in string
- Product code looks like abcd2343, how to split by letters and numbers?
- case-insensitive list sorting, without lowercasing the result?
- How do I change the string representation of a Python class? [duplicate]
- converting string to tuple
- How can I create a random number that is cryptographically secure in python?
- Splitting List That Contains Strings and Integers
- Get the number of occurrences of each character
- Replace special characters in a string in Python
- Split string by count of characters
- How to remove numbers from string terms in a pandas dataframe
- How to sort a list of strings in reverse order without using reverse=True parameter?
- Finding all possible case permutations in Python [duplicate]
- How to convert list of intable strings to int [duplicate]
- How do I convert a list of ascii values to a string in python?
- Finding the position of a word in a string
- TensorFlow: Non-repeatable results