Python Forum

Full Version: A simple error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey can someone guide me to right direction as ive stumbled upon what it seems to be a simple error but cant understand what is wrong or missing something out
name = input("Name on your bank account? ")

def name ():
    
    if name=='Sweed':
        print('sw')
    elif name=='SEB':
        print('sb')
    else:
        print("wrong bank name")
with it or without programs runs fine its like its choces to ignore it
You can not use name for variable and def

name = input("Name on your bank account? ")
 
def check_name ():
     
    if name=='Sweed':
        print('sw')
    elif name=='SEB':
        print('sb')
    else:
        print("wrong bank name")

check_name()
damn i couldint wrap my head around of what was wrong thanks for pointing that out it works as intended now