subject

Edhesive 2.5 coding practice (we are using python)

i have to copy and paste the following code and modify the code so that it asks the user to multiply two random numbers from 1 to 10 inclusive. i am unsure how to do this.

import random

random. seed()

# todo: update the following two lines with a call to a function

# from the random library that generates a random number between

# 1 and 10, inclusive.

a = 6 # hint: replace 6 with a function call

b = 3 # hint: replace 3 with a function call

print ("what is: " + str(a) + " x " + str(b) + "? ")

ans = int(input("your "))

if (a * b == ans):

print ("correct! ")

else:

print ("incorrect! ")

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 10:50
The volume v and paper surface area a of a conical paper cup are given by where r is the radius of the base of the cone and h is the height of the cone. a. by eliminating h, obtain the expression for a as a function of r and v. b. create a user-de ned function that accepts r as the only argument and computes a for a given value of v. declare v to be global within the function. c. for v ! 10 in.3 , use the function with the fminbnd function to compute the value of r that minimizes the area a. what is the corresponding value of the height h? investigate the sensitivity of the solution by plotting v versus r. how much can r vary about its optimal value before the area increases 10 percent above its minimum value?
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
The basic work area of the computer is it screen that you when you first fire up your computer
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
If i wanted to include a built-in calendar in a document, what option could i select? draw table insert table insert chart quick tables
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Setting up a home network using wireless connections is creating a a. vpn b. lan c. wan d. mini-internet
Answers: 2
You know the right answer?
Edhesive 2.5 coding practice (we are using python)

i have to copy and paste the following...
Questions
question
Mathematics, 20.08.2020 08:01
question
Mathematics, 20.08.2020 08:01
question
Mathematics, 20.08.2020 08:01
question
English, 20.08.2020 08:01
question
Mathematics, 20.08.2020 08:01