[Tutor] Newbie question: programs not printing
Marc Tompkins
marc.tompkins at gmail.com
Thu Mar 10 14:44:48 EST 2016
On Thu, Mar 10, 2016 at 5:33 AM, Patrick Craine <pcraine at lifesitenews.com>
wrote:
> >>> x = int(raw_input('Enter an integer: '))
> if x%2 == 0:
> print 'Even'
> else:
> print 'Odd'
> if x%3 != 0:
> print 'And not divisible by 3'
> Enter an integer: 3
> >>>
>
> It could be your email program that's messing with your indentation, but
to me it looks like you're not indenting at all. And that would be a
problem - Python is whitespace-aware, and indentation levels are crucial.
Try this (if, that is, MY indentation doesn't get trashed!):
if x%2 == 0:
print 'Even'
else:
print 'Odd'
if x%3 != 0:
print 'And not divisible by 3'
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=oa-2115-f>
0
viruses found. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=oa-2115-f>
<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
More information about the Tutor
mailing list