I have been programming in Python for a month but I have never written a test case. I am trying to write 2 test sets to the test decision of my following program:
#!/usr/bin/python3
def books():
a = input("Enter number of books:")
inp = int(a)
if inp==0:
print("You earned 0 points")
elif inp==1:
print("You earned 5 points")
elif inp==2:
print("You earned 15 points")
elif inp==3:
print("You earned 30 points")
elif inp==4:
print("You earned 60 points")
else:
print("No Negatives")
books()
How do I write 2 test sets to test the decision for this program? Thanks!
Edits for second version of the question:
You will be able to avoid the list if there is a direct correlation between the number of books and the number of points, but I don’t know your algorithm for that.
If the values for
inpwere strings then you can use a dictionary instead of a list.