Third Task- The program needed the user to enter how many day to go until their birthday and the program had to respond with a list of _ days to go or _day to go.For this to work I programmed it to ask How many days to go? then used looping and range,with -1 to go backwards. Then used if and i== 1 to print day to go and else for days to go.
The coding
count = input("How many days to go?: ")
for i in range(int(count),0, -1):
if (i ==1 ):
print(i, "day to go.")
else:
print(i,"days to go.")
No comments:
Post a Comment