How can this Python code homework be completed? [closed]
How can I complete this Python homework question?
Complete the following assignment statement with the proper random command (either randint or randrange) to simulate the roll of a single six-sided die.
die = _______________
python random
closed as too broad by Carcigenicate, rahlf23, Peter O., halfer, tripleee Nov 16 '18 at 8:26
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
How can I complete this Python homework question?
Complete the following assignment statement with the proper random command (either randint or randrange) to simulate the roll of a single six-sided die.
die = _______________
python random
closed as too broad by Carcigenicate, rahlf23, Peter O., halfer, tripleee Nov 16 '18 at 8:26
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
5
What have you tried? What specifically do you need help with?
– Carcigenicate
Nov 15 '18 at 19:40
add a comment |
How can I complete this Python homework question?
Complete the following assignment statement with the proper random command (either randint or randrange) to simulate the roll of a single six-sided die.
die = _______________
python random
How can I complete this Python homework question?
Complete the following assignment statement with the proper random command (either randint or randrange) to simulate the roll of a single six-sided die.
die = _______________
python random
python random
edited Nov 16 '18 at 7:59
halfer
14.7k759115
14.7k759115
asked Nov 15 '18 at 19:38
Jaydin MoskowitzJaydin Moskowitz
11
11
closed as too broad by Carcigenicate, rahlf23, Peter O., halfer, tripleee Nov 16 '18 at 8:26
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as too broad by Carcigenicate, rahlf23, Peter O., halfer, tripleee Nov 16 '18 at 8:26
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
5
What have you tried? What specifically do you need help with?
– Carcigenicate
Nov 15 '18 at 19:40
add a comment |
5
What have you tried? What specifically do you need help with?
– Carcigenicate
Nov 15 '18 at 19:40
5
5
What have you tried? What specifically do you need help with?
– Carcigenicate
Nov 15 '18 at 19:40
What have you tried? What specifically do you need help with?
– Carcigenicate
Nov 15 '18 at 19:40
add a comment |
2 Answers
2
active
oldest
votes
if all you're trying to do is store a random number from 1-6 inside the variable die
then:
import random
die = random.randint(1,6)
add a comment |
from random import randint
die = randint(1, 6)
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
if all you're trying to do is store a random number from 1-6 inside the variable die
then:
import random
die = random.randint(1,6)
add a comment |
if all you're trying to do is store a random number from 1-6 inside the variable die
then:
import random
die = random.randint(1,6)
add a comment |
if all you're trying to do is store a random number from 1-6 inside the variable die
then:
import random
die = random.randint(1,6)
if all you're trying to do is store a random number from 1-6 inside the variable die
then:
import random
die = random.randint(1,6)
answered Nov 15 '18 at 19:47
brandonebrandone
255
255
add a comment |
add a comment |
from random import randint
die = randint(1, 6)
add a comment |
from random import randint
die = randint(1, 6)
add a comment |
from random import randint
die = randint(1, 6)
from random import randint
die = randint(1, 6)
edited Nov 15 '18 at 19:56
answered Nov 15 '18 at 19:46
JRehlJRehl
194
194
add a comment |
add a comment |
5
What have you tried? What specifically do you need help with?
– Carcigenicate
Nov 15 '18 at 19:40