This file contains hidden or 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
| y = 12 | |
| if y % 2 != 0: | |
| print("y is even.") | |
| else: | |
| print("y is odd.") |
This file contains hidden or 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
| x = 32 | |
| if x % 2 == 0: | |
| print("x is even") | |
| if x == 32: | |
| print("And x is 32.") |
This file contains hidden or 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
| class Rectangle(): | |
| recs = [] |
This file contains hidden or 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
| from random import shuffle | |
| class Card: | |
| suits = ["spades", "hearts", "diamonds", "clubs"] | |
| values = [None, None,"2", "3", "4", "5", "6", "7", "8", | |
| "9", "10", "Jack", "Queen", "King", "Ace"] | |
| def __init__(self, v, s): |
This file contains hidden or 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
| n = 12 | |
| if n % 2 == 0: | |
| print("n is even.") | |
| else: | |
| print("n is odd.") | |
| n = 11 | |
| n = int(n) | |
| if n % 2 == 0: |
This file contains hidden or 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
| def even_odd(n): | |
| if n % 2 == 0: | |
| print("n is even.") | |
| else: | |
| print("n is odd.") | |
| even_odd(10) | |
| even_odd(11) | |
| even_odd(12) |
This file contains hidden or 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
| """"I jumped over the puddle. It was 12 feet!"""".split(".") |
This file contains hidden or 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
| for i in range(100): | |
| print(i) |
This file contains hidden or 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
| for i in range(100): | |
| i += 1 | |
| i +- 1 | |
| print(i) |
This file contains hidden or 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
| for i in range(n): | |
| print(n) |