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(1,100): | |
| if i % 3 == 0 and i % 5 == 0: | |
| print('FizzBuzz') | |
| elif i % 3 == 0: | |
| print('Fizz') | |
| elif i % 5 == 0: | |
| print('Buzz') | |
| else: | |
| 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
| from random import choice, randint | |
| color = [ | |
| 'Blue', | |
| 'Red', | |
| 'Green', | |
| 'Yellow', | |
| 'Cyan', | |
| 'Magenta', | |
| ] |
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
| noun1 = input("Give me a noun ") | |
| noun2 = input("Give me another noun ") | |
| noun3 = input("Give me another noun ") | |
| number1 = input("Give me number ") | |
| country1 = input("Give me a name of a country") | |
| country2 = input("Give me a name of another country") | |
| adj1 = input("Give me an adjective") | |
| fancy1 = input("Give me a fancy word") | |
| year1 = input("Give me a year") | |
| science1 = input("Give me a scientific term") |
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
| import random | |
| n = random.randint(1,100) | |
| guess = int(input("Enter a integer from 1 to 100: ")) | |
| while n != "guess": | |
| if guess < n: | |
| print ("Guess is too low") | |
| guess = int(input("Enter a integer from 1 to 100: ")) | |
| elif guess > n: | |
| print ("Guess is too high") |
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
| a = int(input("What is your first number that you would like to use? ")) | |
| b = int(input("What is your second number that you would like to use? ")) | |
| math = input("Would you like to add/sub/mul/div? ") | |
| if math == "add": | |
| c = a + b | |
| elif math == "sub": | |
| c = a - b |
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
| answer = int(input('Pick a number ')) #input by itself creates a string, so that is why we are using INT to convert from string to integer | |
| if answer > 10: | |
| print("Your number is greater than 10") | |
| elif answer < 10: | |
| print("Your number is less than 10") | |
| else: | |
| print("Your number is equal to 10") | |
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
| number = int(input('Enter a number ')) #input by itself creates a string, so that is why we are using INT to convert from string to integer | |
| if number > 10: | |
| print("Your number is greater than 10") | |
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
| answer = int(input('Pick a number ')) #input by itself creates a string, so that is why we are using INT to convert from string to integer | |
| if answer > 10: | |
| print("Your number is greater than 10") | |
| else: | |
| print("Your number is less than or equal to 10") |
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
| while True: | |
| answer = input("Name a color and press enter: ") | |
| print("Please enter another color besides \"" + answer + "\" please.") | |
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
| answer = "y" | |
| while answer == "y": | |
| print("I need the nectar from the gods!") | |
| answer = input("Do you like coffee? (y/n)") | |
| print ("What is wrong with you!") |