program-entry-point

How do I create a function/method out of this code and then call it to the main()?

How do I create a function/method out of this code and then call it to the main()? Question: enter code hereThis is the original code that I wrote: while True: user_input = (input(">>",)) try: user_input = int(user_input) except ValueError: pass if user_input in range(1, len(something): break I want to put in a method: `get_user_answer(n: int, …

Total answers: 3

Unsupported operand type(s) for +=: 'int' and 'datetime.timedelta'

Unsupported operand type(s) for +=: 'int' and 'datetime.timedelta' Question: This is the error im getting: Exception has occurred: TypeError unsupported operand type(s) for +=: ‘int’ and ‘datetime.timedelta’ I have searched for other people with similiar problems, but couldn’t quite find anything to similiar to mine. I havent gotten this problem before either. I want to …

Total answers: 1