Python/CheatSheet

From Wiki
< Python
Revision as of 11:25, 18 September 2017 by Marcluer (talk | contribs)

If Then Else

if x < 0:
    print('Negative')
elif x == 0:
    print('Zero')
else:
    print('More')


For loops

for x in ['cat', 'dog', 'bird']:
    print (w)