Python Forum
I have Traceback error and a type error and i dont know how to fix it
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()
Reply
#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
Reply
#3
figured it out thanks though
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Wrong type error rowan_bradley 6 1,142 Aug-07-2023, 10:44 AM
Last Post: rowan_bradley
  Type Error: Unsupported Operand jhancock 2 1,067 Jul-22-2023, 11:33 PM
Last Post: jhancock
  [ERROR] ParamValidationError: Parameter validation failed: Invalid type for parameter gdbengo 3 10,634 Dec-26-2022, 08:48 AM
Last Post: ibreeden
  I dont know why my function won't work? MehHz2526 3 1,149 Nov-28-2022, 09:32 PM
Last Post: deanhystad
  Python Traceback Error mg24 2 903 Nov-21-2022, 02:35 PM
Last Post: snippsat
  Something the code dont work AlexPython 13 2,127 Oct-17-2022, 08:34 PM
Last Post: AlexPython
  why I dont get any output from this code William369 2 1,084 Jun-23-2022, 09:18 PM
Last Post: William369
  Python Anytree - Is not of type 'NodeMixin' error georgebijum 3 2,026 May-05-2022, 01:43 PM
Last Post: Gribouillis
  Incorrect Type Error milkycow 4 2,828 Jun-25-2021, 06:04 AM
Last Post: milkycow
  pandas.errors.ParserError: Error tokenizing data. C error: Expected 9 fields in line Anldra12 9 15,077 Jun-15-2021, 08:16 AM
Last Post: Anldra12

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020