[Tutor] if/else statement
Joel Goldstick
joel.goldstick at gmail.com
Tue Jul 18 19:08:16 EDT 2017
On Tue, Jul 18, 2017 at 1:31 PM, Shane Johnson (shanejoh) <
shanejoh at cisco.com> wrote:
> I am doing the codeacademy python class and have the following code:
>
> def greater_less_equal_5(answer):
> if answer is '>' 5
>
indent the line after the if
> return 1
> elif answer is < 5:
>
and here
> return 0
> else:
>
and here
> 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
>
> In python, indentation is essential
> 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
>
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
--
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays
More information about the Tutor
mailing list