Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. import random
  2. def multi_practice():
  3.     multi_table_input = input("Enter multiplicaiton table: ")
  4.     number_of_questions_input = input ("Enter number of questions")
  5.     multi_table = int(multi_table_input)
  6.     number_of_questions =int(number_of_questions_input)
  7.     i = 1
  8.     while i <= number_of_questions:
  9.         multiplier = random.randint(1, 10)
  10.         print("What is " + str(multi_table) + " * " + str(multiplier))
  11.         k = input("Enter answer: ")
  12.         print("Correct answer is: " + str (multiplier * multi_table))
  13.         i += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement