Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Count_inputs (inputx, count):
- if inputx in ("y", "Y", "yes", "YES"):
- return count + 1
- elif inputx in ("n", "N", "no", "NO"):
- return count
- else:
- #Catch all other out comes
- print ("Answer Unclear. Use 'y' or 'n'")
- return count
- count = 0
- while True: #Infinite Loop
- newinput = input("Keep going [y/n]? ")
- count = Count_inputs(newinput, count)
- print(f"Count is {count}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement