Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question Create two variables: first and last. Assign 1 to first and 6 to last. Then replace the magic numbers in your code with the

Question

Create two variables: first and last. Assign 1 to first and 6 to last. Then replace the magic numbers in your code with the new variables youve just created.

Here is my current code and I am not sure how to implement the rest what the question is asking. I am not sure if my code is correct or not.

import random roll = random.randint(1, 6)

print ("Choosing a number between 1 and 6") print ("The number is ",end="") print (random.choice([1,2,3,4,5,6]))

When you run the program it should look like this

codio@mike-panther:~/workspace$ python3 die.py Choosing a number between 1 and 6. The number is 2.

Use your variables first and last to create the print statement. In particular, if you change first to 2 and last to 8, you should see something like this.

codio@mike-panther:~/workspace$ python3 die.py Choosing a number between 2 and 8. The number is 5.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions

Question

How did NUMMI give workers some control over the production line?

Answered: 1 week ago

Question

1. Identify and control your anxieties

Answered: 1 week ago