Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 I have Traceback error and a type error and i dont know how to fix it
#1
Im new to python

when i added and else statement to catch mistakes and have it return to the beginning it crashes but it works just fine without the else statement


def add():
name = str(input("What is the character name? "))
print("\nAre you sure your okay with", name, "? y/n ")
check = input().lower()
if check == "y":
a_char.write(name)
a_char.close()
if check == "n":
print("Thats okay please try again!")
add()
else:
print("Sorry I don't understand!")
add()
Quote
#2
Quote:I have Traceback error and a type error and i dont know how to fix it
then post the error unmodified and complete.

Also, use code tags see BBcode
Quote
#3
figured it out thanks though
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Type error: '>' not supported between instances of 'NoneType' and 'int' spalisetty06 1 427 Apr-29-2020, 06:41 AM
Last Post: buran
  Data Type conversion error rajeevjagatap 2 333 Apr-15-2020, 03:29 PM
Last Post: rajeevjagatap
  zlib decompress error: invalid code lengths set / invalid block type DreamingInsanity 0 356 Mar-29-2020, 12:44 PM
Last Post: DreamingInsanity
  Error in Python3.6:free() Corrupted unsorted chunks error sameer_k 2 397 Mar-18-2020, 09:37 AM
Last Post: sameer_k
  Exception: Returned Type Mismatch Error devansing 1 387 Mar-06-2020, 07:26 PM
Last Post: ndc85430
  Traceback error in PyCharm but not in other IDEs? devansing 9 598 Mar-05-2020, 11:27 AM
Last Post: buran
  Nameparser - Traceback error tjnichols 2 309 Feb-28-2020, 05:11 PM
Last Post: GodMaster
  Python Type error! SamAnw 4 373 Feb-14-2020, 03:46 PM
Last Post: buran
  Type hinting - return type based on parameter micseydel 2 301 Jan-14-2020, 01:20 AM
Last Post: micseydel
  how can i handle "expected a character " type error , when I input no character vivekagrey 2 354 Jan-05-2020, 11:50 AM
Last Post: vivekagrey

Forum Jump:


Users browsing this thread: 1 Guest(s)