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, 21.06.2019 20:20
Sometimes writers elaborate on the truth when recalling past events so they can enhance their narrative essay with more interesting descriptions. do you feel that published writers should or should not embellish real life events just to make their stories more interesting?
Answers: 2
question
Computers and Technology, 22.06.2019 17:00
What allows you to create a wireless connection among your smart devices
Answers: 2
question
Computers and Technology, 22.06.2019 19:00
How is the number 110 written when expanded out to place values in the base 2 (binary) number system? options: 2 x 4 + 3 x 2 + 4 x 1 1 x 2 + 1 x 2 + 0 x 2 1 x 100 + 1 x 10 + 0 x 1 1 x 4 + 1 x 2 + 0 x 1
Answers: 1
question
Computers and Technology, 23.06.2019 01:10
Are special combinations of keys that tell a computer to perform a command. keypads multi-keys combinations shortcuts
Answers: 1
You know the right answer?
Edhesive 2.5 coding practice (we are using python)

i have to copy and paste the following...
Questions
question
Chemistry, 29.01.2020 14:03
question
Mathematics, 29.01.2020 14:03
Questions on the website: 13722367