I am trying to create a loop if a negative number is entered to prompt the user to re-enter a valid rating, but I keep receiving a syntax error can someone help point out which part does not look right. I am new to this so it's going over my head. Thanks in advance.
def detailLoop():
global numOfStars
if (rating >4):
print ("Out of range. ")
rating = float(input("Enter a star rating or a negative number to quit: ")
elif (numOfStars >= lowestRating) and (numOfStars <= maxRating):
rating=rating+numOfStars
count=count+1
# If Negative Value Is Entered
else: (numOfStars<0):
print("End of Program")
return
Aucun commentaire:
Enregistrer un commentaire