Python - random.choice and time.sleep
Loading...
127
views
Loading...
Uploader Comments (MinutemanM1A1)
see all
All Comments (6)
-
no not exactly. however i got it to work with the sentence as long as u have it bettween the " " you can have an entrie sentence.
On another note if i wanted the random output to give me 2 results. For example it was a chicken and a Hen. How would you achive that?
-
hahahahaha!!!! chicken hen rooster... :3
Loading...
I would like to input coordinates where my objects should appear. For instance i put random.choice(['0,4', '0,-4', '4,0', '-4,0']). Can i use random.choice to pick one of the coordinates randomly? it always chooses only one position and never changes.
Artyom109Zinchenko 7 months ago
@Artyom109Zinchenko yes, it should give you a random coordinate, however, if you are going to do it you will want to make the list ([(0, 4), (0, -4), (4, 0), (-4, 0)])
MinutemanM1A1 7 months ago
For the random choice would you be able to put entire sentences insted of just a single word like hen or chicken. Would it still work?
Bozic123 10 months ago
@Bozic123 well, in a random.choice you can only put in a list (whatever is in the [ ] brackets). in the list, there are only variables, so you would have to assign a section of code to a variable. you cannot put raw code into a list, but you can make it into a variable. do you get what i'm saying?
MinutemanM1A1 10 months ago