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
  Changing a traceback message without a 2nd raise Clunk_Head 1 71 Yesterday, 12:45 AM
Last Post: Gribouillis
  Type error: dump() missing 1 required positional argument: fp jaycuff13 2 133 Jul-13-2019, 10:21 AM
Last Post: jaycuff13
  Invalid archive error when attempting to install dash bootstrap components meaydemi 0 91 Jul-11-2019, 05:49 PM
Last Post: meaydemi
  Py4JJavaError: An error occurred while calling o22720.csv. twinpiques 0 53 Jul-11-2019, 12:41 AM
Last Post: twinpiques
  syntax error on list.sort() jjordan33 3 98 Jul-10-2019, 04:57 PM
Last Post: jefsummers
  pyodbc.Error SQLBindParameter pcarra 0 63 Jul-08-2019, 08:22 PM
Last Post: pcarra
  Error: int object does not support item assignment ankita_nthu 2 106 Jul-07-2019, 02:14 PM
Last Post: ankita_nthu
  error Rahul 1 80 Jul-07-2019, 12:10 PM
Last Post: metulburr
  Getting Name Error: Name not defined AAD 2 173 Jul-03-2019, 11:43 AM
Last Post: AAD
  [split] No Error, and No Output vishal2894 1 77 Jul-02-2019, 03:20 PM
Last Post: nilamo

Forum Jump:


Users browsing this thread: 1 Guest(s)