Download file

weight = int(input("Your weight in lbs: "))
height =int( input("Your height in inches: "))
bmi = weight / (height * height) * 703
answer = "Your BMI is: {} " 

youAre = "Sorry, you are " 
if bmi <= 18.5: category = "Underweight" elif bmi > 18.5 and bmi <= 24.9: category = "Normal range" youAre = "You are in the " elif bmi > 24.9 and bmi <= 29.9: category = "Overwieght" elif bmi > 29.9: 
   category = "Obese" 
print(answer.format(round(bmi, 2))) 
print(youAre + category)

Download

# You run a hovercraft factory. Your factory makes ten hovercrafts in a month.
# Given the number of customers you got that month, did you make a profit?
# It costs you 2,000,000 to build a hovercraft, and you are selling them for
# 3,000,000. You also pay 1,000,000 each month for insurance.

# TASK:
# Determine whether or not you made a profit based on how many of the ten
# hovercrafts you were a le to sell that month.

# INPUT FORMAT:
# An integer that represents the sales that you made that month.

# OUTPUT FORMAT
# A string that says "Profit', 'Loss', or 'Broke Even'.

# SAMPLE INPUT
# 5

# SAMPLE OUTPUT
# Loss

# Explanation
# If you only had 5 hovercrafts, you spent 21,000,000 to operate but only made
# 15,000,000.

hc = input("Hovercrafts sold: ")
hcs = int(hc)

build = 2000000
eachhc = 3000000

ins = 1000000

a = hcs * eachhc
spent = (10 * build) + ins

amtmd = "Amount made: "
print(f'{amtmd}{a}')

if a == spent:
print("Breoke even")
elif a >= spent:
print("Profit")
elif a <= spent:
print("Loss")

Download

# Creation must start somewhere

# Ask user for name
userName = input("What's your name? \n\n").upper()
print()

# Create variables for the letters
letA = "...####...\n..#....#..\n..######..\n..#....#..\n..#....#..\n\n"
letB = "..#####...\n..#....#..\n..#####...\n..#....#..\n..#####...\n\n"
letC = "...#####..\n..#.......\n..#.......\n..#.......\n...#####..\n\n"
letD = "..#####...\n..#....#..\n..#....#..\n..#....#..\n..#####...\n\n"
letE = "..######..\n..#.......\n..######..\n..#.......\n..######..\n\n"
letF = "..######..\n..#.......\n..######..\n..#.......\n..#.......\n\n"
letG = "..######..\n..#.......\n..#..###..\n..#....#..\n..#####...\n\n"
letH = "..#....#..\n..#....#..\n..######..\n..#....#..\n..#....#..\n\n"
letI = "..######..\n....##....\n....##....\n....##....\n..######..\n\n"
letJ = "..######..\n....##....\n....##....\n..#.##....\n..####....\n\n"
letK = "..#...#...\n..#..#....\n..##......\n..#..#....\n..#...#...\n\n"
letL = "..#.......\n..#.......\n..#.......\n..#.......\n..######..\n\n"
letM = "..#....#..\n..##..##..\n..#.##.#..\n..#....#..\n..#....#..\n\n"
letN = "..#....#..\n..##...#..\n..#.#..#..\n..#...##..\n..#....#..\n\n"
letO = "...####...\n..#....#..\n..#....#..\n..#....#..\n...####...\n\n"
letP = "..#####...\n..#....#..\n..#####...\n..#.......\n..#.......\n\n"
letQ = "...####...\n..#....#..\n..#..#.#..\n..#...#...\n...###.#..\n\n"
letR = "..#####...\n..#....#..\n..#####...\n..#...#...\n..#....#..\n\n"
letS = "...#####..\n..#.......\n...####...\n.......#..\n..#####...\n\n"
letT = "..######..\n....##....\n....##....\n....##....\n....##....\n\n"
letU = "..#....#..\n..#....#..\n..#....#..\n..#....#..\n...####...\n\n"
letV = "..#....#..\n..#....#..\n..#....#..\n...#..#...\n....##....\n\n"
letW = "..#....#..\n..#....#..\n..#.##.#..\n..##..##..\n..#....#..\n\n" 
letX = "..#....#..\n...#..#...\n....##....\n...#..#...\n..#....#..\n\n"
letY = "..#....#..\n...#..#...\n....##....\n....##....\n....##....\n\n"
letZ = "..######..\n......#...\n....##....\n...#......\n..######..\n\n"
letSP = "..........\n..........\n..........\n..........\n..........\n\n"

for c in userName:
    if c == "A":
        print(letA)
    elif c == " ":
        print(letSP)
    elif c == "B":
        print(letB)
    elif c == "C":
        print(letC)
    elif c == "D":
        print(letD)
    elif c == "E":
        print(letE)
    elif c == "F":
        print(letF)
    elif c == "G":
        print(letG)
    elif c == "H":
        print(letH)
    elif c == "I":
        print(letI)
    elif c == "J":
        print(letJ)
    elif c == "K":
        print(letK)
    elif c == "L":
        print(letL)
    elif c == "M":
        print(letM)    
    elif c == "N":
        print(letN)
    elif c == "O":
        print(letO)
    elif c == "P":
        print(letP)
    elif c == "Q":
        print(letQ)
    elif c == "R":
        print(letR)
    elif c == "S":
        print(letS)
    elif c == "T":
        print(letT)
    elif c == "U":
        print(letU)
    elif c == "V":
        print(letV)
    elif c == "W":
        print(letW)
    elif c == "X":
        print(letX)
    elif c == "Y":
        print(letY)
    elif c == "Z":
        print(letZ)
    else:
        print("Please only use letters")  

Download

import os

_path = '/Users/' #or some other path

_files = os.listdir(_path)

for _file in _files:
print(_file)

Download

import random

def roll_dice(min_val, b):
while True:
print("Dice Rolling...")
print(f"Your number is {random.randint(min_val, b)}")
result = input("Do you want to roll the dice again? (y/n) ")
if result.lower() == "n":
break

b = input("Enter sided dice number: ")

roll_dice(1, int(b))

Git taskGit commands
Tell Git who you aregit config --global user.name "Sam Smith"

git config --global user.email [email protected]

Create a new local repositorygit init
Check out a repositorygit clone /path/to/repository

git clone [email protected]:/path/to/repository

Add filesgit add

git add *

Commitgit commit -m "Commit message"

git commit -a

Pushgit push origin master
Statusgit status
Connect to a remote repositorygit remote add origin

git remote -v

Branchesgit checkout -b

git checkout

git branch

git branch -d

git push origin

git push --all origin

git push origin :

Update from the remote repositorygit pull

git merge

git diff

git diff --base

git diff

git add

Tagsgit tag 1.0.0

git log

git push --tags origin

Undo local changesgit checkout --

git fetch origin

git reset --hard origin/master

Searchgit grep "foo()"