Re: [Tutor] if/else statement

2017-07-18 Thread Mats Wichmann
And one more, the 'if' needs a colon at the end On July 18, 2017 5:10:30 PM MDT, Alan Gauld via Tutor wrote: >On 18/07/17 18:31, Shane Johnson (shanejoh) wrote: > >> def greater_less_equal_5(answer): >>if answer is '>' 5 >>return 1 >>elif answer is < 5:

Re: [Tutor] if/else statement

2017-07-18 Thread Alan Gauld via Tutor
On 18/07/17 18:31, Shane Johnson (shanejoh) wrote: > def greater_less_equal_5(answer): >if answer is '>' 5 >return 1 >elif answer is < 5: >return 0 >else: >return 4 > I’m getting a invalid syntax line 2 error. Any assistance is greatly >

Re: [Tutor] if/else statement

2017-07-18 Thread Joel Goldstick
On Tue, Jul 18, 2017 at 1:31 PM, Shane Johnson (shanejoh) < shane...@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

[Tutor] if/else statement

2017-07-18 Thread Shane Johnson (shanejoh)
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

Re: [Tutor] Python Questions

2017-07-18 Thread Mats Wichmann
On 07/18/2017 11:42 AM, Alan Gauld via Tutor wrote: > On 18/07/17 11:41, Max Smith wrote: > >> What's the easiest way to learn python currently > > Write a lot of code. > > As to which tutorial to follow, that's a very personal choice and > depends on your previous knowledge and learning

Re: [Tutor] Python Questions

2017-07-18 Thread Alan Gauld via Tutor
On 18/07/17 11:41, Max Smith wrote: > What's the easiest way to learn python currently Write a lot of code. As to which tutorial to follow, that's a very personal choice and depends on your previous knowledge and learning style. If you can already program in a similar language(say Perl, PHP or

[Tutor] Python Questions

2017-07-18 Thread Max Smith
I have some questions about python. What's the easiest way to learn python currently I'm using google's excersise program, I'm just reading and making notes then testing out what I have learnt. Since I' need to understand python fully as I've got a exam in Python for my GCSE's if you could