Python Forum

Full Version: I have Traceback error and a type error and i dont know how to fix it
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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: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
figured it out thanks though