Created
August 27, 2012 00:59
-
-
Save victorb/3484771 to your computer and use it in GitHub Desktop.
Övning 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Skriver ut | |
print "I will now count my chickens:" | |
# Räknar ut "hens" | |
print "Hens", 25 * 30 / 6 | |
# Räknar ut "roosters" | |
print "Roosters", 100 - 25 * 3 % 4 | |
print "Now I will count the eggs:" | |
# Plussar massa saker | |
print 3.0 + 2.0 + 1.0 + - 5.0 + 4.0 % 2.0 - 1.0 / 4.0 + 6.0 | |
# Skriver | |
print "Is it true that 3 + 2 < 5 - 7?" | |
# Om 3 + 2 (5) är mindre än 5 - 7 (-2) | |
print 3 + 2 < 5 - 7 | |
# Vad är 3 + 2? | |
print "What is 3 + 2?", 3 + 2 | |
# Vad är 5 - 7? | |
print "What is 5 -7?", 5-7 | |
print "Oh, that's why it's False." | |
print "How about some more." | |
# Om 5 är större än -2 | |
print "Is it greater?", 5 > -2 | |
# Om 5 är större eller lika med -2 | |
print "Is it greater or equal?", 5 >= -2 | |
# Om 5 är mindre eller lika med -2 | |
print "Is it less or equal?", 5 <= -2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment