0

Good day everyone, I need to print data using if-elif statement. I when I run this code like this, everything went well

if row['username'] == 'mutago':
        
        print " okay"
        sys.exit(0)
 else:
     print "wrong"

OKAY now i want to include elseif statement to print another data but it returns error. below is the error code

if row['username'] == 'mutago':
        
        print " okay"
        sys.exit(0)
elif row['password']=='muta55':
print "good"
 else:
     print "wrong"

i have tried also elseif but does not work

5
Contributors
5
Replies
7
Views
5 Years
Discussion Span
Last Post by woooee
0

Here this will help you.

if row['username'] == 'mutango':
    if row['password'] == 'muta55':
        print "okay"
        sys.exit(0)
else:
   print "Wrong"
0

The OP has it correct

I need to print data using if-elif statement
elif row=='muta55':

.

Edited by woooee: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.