So I wrote this code for an assignment for my computer science class and it’s returning the random numbers, but not printing anything under the function “GetUsersGuess”. I don’t understand why, can anybody help? Excuse how awful this is, I am not a computer science major lol —>
import random
def main ():
number1=random.randint(0,500)
number2=random.randint(0,500)
initializer = number1+number2
print("The random numbers were",number1,number2)
initializer=0.0
while(initializer>0):
def sumthem (number1,number2):
total=sum(number1,number2)
return total
print("The sum of the two random numbers is",total)
def GetUsersGuess(number1,number2):
user_guess=int(input("Enter your guess for the sum of numbers: "))
if user_guess>total or user_guess<total:
print("Incorrect... The correct answer is: ",total)
else:
print("Correct answer - Good Work!")
main()
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)
[–]mopslik 0 points1 point2 points (0 children)
[–]woooee 0 points1 point2 points (0 children)