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
"hello world" -# Okay! :-) | |
'hello world' - #Okay! :-) | |
"hello world' - #No Good :-( |
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
str1 = "spider" | |
str2 = "pig" | |
str3 = str1 + str2 | |
print(str3) |
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
print((4 * 5) + 2) | |
print(4 * (5 + 2)) | |
#Try typing these lines above in to python | |
#Do the come up with the same answer or a different answer? |
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
print(True and True) | |
print(True and False) | |
print(False and False) |
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
username = input("Please enter your username:") | |
password = input("Please enter your password:") | |
if username == "aladin" and password == "abracadabra": | |
print("You can enter the cave of many shiny treasures") |
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
fav = input("What's your favourite color?") | |
if fav == "green" or fav == "brown": | |
print("That's one of my favourite colors too!") |
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
movie = input("What's your favourite movie?") | |
if not movie == "Monty Python's Life of Brian": | |
print("You father was a hamster and your mother smelled of elderberries!") |
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
#Simple darts game | |
#Each player gets 6 attempts to score as close to 180 as possible. | |
#If your total is over 180 you are bust and you lose | |
import os | |
total = 0 | |
for i in range(6): | |
os.system('clear') | |
print("Current score - " +str(total) + "\n\n") | |
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
for i in range(100): | |
choice = input("Do you want to stop now?") | |
if choice == "yes": | |
break | |
print("Goodbye then!") |
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
import os | |
#Global variables and lists to be used throughout my program. | |
wordsList = ["dog","cat","mouse","hyena"] | |
usedLetters = [] | |
lives = 5 | |
def mainScreen(): | |
os.system('clear') | |
print("Welcome to the Hangman game\n\n") |