[Tutor] if/else statement

Shane Johnson (shanejoh) shanejoh at cisco.com
Tue Jul 18 13:31:20 EDT 2017


I am doing the codeacademy python class and have the following code:

def greater_less_equal_5(answer):
       if answer is '>' 5
       return 1
       elif answer is < 5:
       return 0
       else:
       return 4

print greater_less_equal_5(4)
print greater_less_equal_5(5)
print greater_less_equal_5(6)

I’m getting a invalid syntax line 2 error. Any assistance is greatly appreciated.

[cid:image001.png at 01D2FFCA.286FD4E0]
Shane Johnson
Network Consulting Engineer
Cisco Services
shanejoh at cisco.com<mailto:paroche at cisco.com>
Phone: +1 770-236-3970
Mobile: +1 404-966-5334


Cisco.com<http://www.cisco.com/>



[cid:image002.png at 01D2FFCA.286FD4E0]Think before you print.

This email may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message.
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html





More information about the Tutor mailing list