-1

i have a question regarding a function. During the first part i asked the user to input an number, so that i can use it input for a function, but it doesn't notice this input.

 def Hi():
    n = raw_input('1-4')
    if n == 1:
        print 'Hello'

1 Answers1

0

you need to convert input string to int

def Hi():
    n = int(raw_input('1-4'))
    if n == 1:
        print 'Hello'
Dharmesh Fumakiya
  • 2,276
  • 2
  • 11
  • 17