+ 10
Is there a way to exit a module?
For example, let's say I import the random module to shuffle a list, I like the way it is shuffled. Now, how do I exit the random module to keep my list from being shuffled anytime I press a key? Can this be done? Something like this: https://code.sololearn.com/chY4TRV8yKMb/?ref=app
5 Réponses
+ 3
Tomiwa Joseph
I'm not sure if I understood the question well but why not put shuffle(name) in a while loop so that once the desired list arrangement is reached, the user can enter a string (or whatever) like "done" to break from the loop. Then you can go from there... 🤔
+ 1
Return
0
It's not what you type after ')'
It's that the random function returns a different value each time you run the code because I think it depends on time
0
Doniyorbek Urinboyev yeah, sometimes i don't know if "computers" like this are extremely clever or absolutely stupid, lol
0
When you hit run the random function gives another value so the string changes.. mmh what would you like to do?