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 pygame | |
import random | |
import math | |
from pygame import mixer | |
# Initialize the pygame | |
pygame.init() | |
# Create the screen | |
screen = pygame.display.set_mode((800, 600)) |
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 translate(phrase): | |
translation = "" | |
for letter in phrase: | |
if letter.lower() in "aeiou": | |
if letter.isupper(): | |
translation = translation + "G" | |
else: | |
translation = translation + "g" | |
else: |
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
secret_word = "Giraffe" | |
guess = "" | |
guess_count = 0 | |
guess_limit = 3 | |
out_of_guesses = False | |
while guess != secret_word and not(out_of_guesses): | |
if guess_count < guess_limit: | |
guess = input("Enter Guess: ") | |
guess_count += 1 |
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
num1 = float(input("Please enter first number: ")) | |
op = input("Please enter operator: ") | |
num2 = float(input("Please enter second number ")) | |
if op == "+": | |
print(num1 + num2) | |
elif op == "-": | |
print(num1 - num2) | |
elif op == "/": | |
print(num1 / num2) |
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
is_male = True | |
is_tall = False | |
if is_male and is_tall: | |
print("You are a tall male") | |
elif is_male and not is_tall: | |
print("You are a short male") | |
elif not is_male and is_tall: | |
print("You are not a male, but are tall") | |
else: |