0

I wrote the below code and tried to run it, but it's not running. Does it have a bug that I can't spot?

def greet():
    print('Hi there mister')

kor_Var = input('Enter kor')

if kor_Var != walls:
   print('Incorrect pin')
else:
   greet()
3
  • 3
    walls is not a string, use 'walls'. Or you didnt show it. And what do you mean by its not running? Commented Dec 8, 2018 at 4:35
  • What is "Kor"? Coordinate? Commented Dec 8, 2018 at 7:11
  • What do you mean by "it's not running"? Commented Dec 8, 2018 at 7:48

1 Answer 1

1

You need to change "walls" as string:

def greet(): 
    print('Hi there mister')

kor_Var = input('Enter kor')
if kor_Var != "walls":
    print('Incorrect pin') 
else: 
    greet()
Sign up to request clarification or add additional context in comments.

2 Comments

This worked fine when I tried it, using either "walls" or 'walls' (Python 3.6.3 (Anaconda)). I don't understand why Jamuhuri Fuschia can't get it to work.
sorry i took forever to reply. The snippet ran, and am practicing a lot that is why I haven't logged in lately.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.