subject
Computers and Technology, 02.12.2020 21:50 peno211

Can someone translate this is Python language PLEASE! # A program to practice adding and multiplying.
# Initialize the number lists.
# Ask the user whether to practice adding or multiplying.
# Generate number problems and ask for an answer.
# Compare the user's answer to the correct answer.
# Keep score.
# Tell the user how they did.

# A program to practice adding and multiplying.
# Initialize the number lists.
numA = [4, 1, 6, 10, 2, 3, 7, 9, 11, 12, 5, 8 ]
numB = [2, 12, 10, 11, 1, 3, 7, 9, 4, 8, 5, 6]
numberFacts = len(numA)

# Ask the user whether to practice adding or multiplying.
print("You can add or multiply.")
mode = input("Enter A for add or M for multiply: ")
mode = mode. lower()

# Generate number problems and ask for an answer.
if mode == 'm':
for n in range(numberFacts):
print("What is", numA[n], "times" , numB[n], "?")
product = numA[n] * numB[n]
answer = input(" ")
try:
answer = float(answer)
except ValueError:
print("You did not enter a number. Try again on a new problem.")
print("")
continue
if answer == product:
print("Correct! Way to go!")
else:
print("Sorry, the answer is", product, ".")
print("")
elif mode == 'a':
for n in range(numberFacts):
print("What is", numA[n], "plus" , numB[n], "?")
product = numA[n] + numB[n]
answer = input(" ")
try:
answer = float(answer)
except ValueError:
print("You did not enter a number. Try again on a new problem.")
print("")
continue
if answer == product:
print("Amazing!")
else:
print("Sorry, the answer is", product, ".")
print("")
else:
print("You did not make a valid choice. You needed to choose A or M.")

# Below is the pseudocode before code was added

# Compare the user's answer to the correct answer.
# Keep score.
# Tell the user how they did.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:30
Show that there is a language a ⚆ {0, 1} â— with the following properties: 1. for all x â a, |x| ≤ 5. 2. no dfa with fewer than 9 states recognizes a. hint: you don’t have to define a explicitly; just show that it has to exist. count the number of languages satisfying (1) and the number of dfas satisfying (2), and argue that there aren’t enough dfas to recognize all those languages. to count the number of languages satisfying (1), think about writing down all the strings of length at most 5, and then to define such a language, you have to make a binary decision for each string about whether to include it in the language or not. how many ways are there to make these choices? to count the number of dfas satisfying (2), consider that a dfa behaves identically even if you rename all the states, so you can assume without loss of generality that any dfa with k states has the state set {q1, q2, . . , qk}. now think about how to count how many ways there are to choose the other four parts of the dfa.
Answers: 3
question
Computers and Technology, 22.06.2019 19:00
If your accelerator suddenly gets stuck what should you do
Answers: 2
question
Computers and Technology, 24.06.2019 05:30
Cómo pongo un tomo de llamada sin pagar?
Answers: 1
question
Computers and Technology, 24.06.2019 14:30
Ahousehold consists of a married couple and their twin five-year old daughters. the couples children had no income and lived with their parents all of last year. how many exemptions can the couple claim on last years tax return or they file with the “ married filing jointly “ status? a. 4 b. 5 c. 3 d. 2
Answers: 1
You know the right answer?
Can someone translate this is Python language PLEASE! # A program to practice adding and multiplyin...
Questions
question
Mathematics, 25.06.2019 15:00
question
Spanish, 25.06.2019 15:00
question
Mathematics, 25.06.2019 15:00
Questions on the website: 13722361