import random
list = []
word=int(input('Enter:')))
list.append(word)
random.shuffle(list)
print(list)
I'm trying to do this, but it's not mixed What's the problem?
python
import random
l = list(input('Enter:')))
random.shuffle(l)
print(l)
If you don't have to change the values in the list to integer, you can do it in the same way as above.
import random
list = []
word=str(input('Enter:'))
for i in range(0, len(s)):
list.append(i)
random.shuffle(list)
print(list, "output")
This is how it works. I don't know if the result of your question is correct. (If you change the number of digits in the input, you need to add some code back to the part that handles the input value)
© 2024 OneMinuteCode. All rights reserved.