# Huong Dang
# Junior knights 9/23/17 First class


############### PART 1: PRINTING ####################

# Strings to be printed are encased in double or single
# quotation marks
print("Hello World!")


# Error message will occur if you try this
# because Python doesn't recognize what Hello and
# World stores
# print(Hello World)

# Escape sequences
# \t == "    What I'm writing has been tabbed"
# \" == Printing a double quotation mark
# \' == Printing a quotation mark
# \\ == Printing a backslash
# \n == new line 

print("\tThis is the start of a poem about nothingness")
print("My mom\'s cooking is the best")
print("You'll probably say, \"No, it's not!\"")
print("But I'll fight you with a backslash \\")



# You can add two strings together
# This will become more useful when you learn variables
print("Hello my name is " + "Huong")

# You can multiply number of strings
print("\nHello"*5)



# mOrE fun example
for i in range(6):
  print("*"*i)

for i in range(6):
  print("*"*(6 - i))
  
print("Tada!")


  
# Using sep and end 
print("Hello, I would like to ", end = "")
print("buy your shirt!")

print("What", "is", "your", "name", "?")
print("What", "is", "your", "name", "?", sep = "")
  
  
# Main points:
# 1) Print your strings with quotation marks
# 2) Learn your escape sequences
# 3) String concatenation and multiplications
# 4) Using sep and end 

print("\n\n\n\n\n")

  
###################### PART 2: VARIABLES ###################### 

# A variable stores a value
# You can name a variable whatever you like, but you 
# ALWAYS want to give useful names so that other 
# people who read your code has better context 

name = "Huong" # Name is a variable that stores my name 
print(name)

# I can change what the variable stores by rewriting it
# and setting something else equal to it

name = "Chris"
print(name)
name = "Arati"
print(name)
name = "Minh-Chau"
print(name)
name = "Rachael"
print(name)

print("\n")

# Variables can also store integers
age = 15
print(age)
age = 17
print(age)
age = 81
print(age)

print('\n')

# Variables can also store floating point numbers 
# aka decimal points
pi = 3.14 # approximately don't quote me on This
print(pi)

# Doing math with variable 
# Area of a triange = (1/2)*(base)*(height)

# Let's say that I want to find the area of 
# a triangle with base = 3 and height = 4 
# I can write code so that variable area will store the
# area of the triangle with base 3 and height 4 

base = 3
height = 4
area = (1/2)*(base)*(height) # Writing this alone will
# give you an error message because you have not 
# defined what base and height is 

# PRINT TO SCREEN OR YOU'LL SEE NOTHINGNESS AND BE SAD
print(area)

########## PART 3: INPUT/OUTPUT AND MATH #############

# What if I want to be able to compute the area
# of any triangle with base and height that you give me?
# I would first, take your input and put it into variables
# then do math with it and return the result to you

base = int(input("Enter your triangle's base. "))
height = int(input("Enter your triangle's height. "))
area = (1/2)*base*height

# Make sure you understand how the following print
# statement works and why it does what it does 
print("The area of your triangle with base", base, "and",
      "height", height, "is", area, end = ".")


print("\n\n\n")
# What if I want to input anyone's name and
# then print out a welcome message to them?
name = input("What is your name?")
print("Welcome "+ name, "!", sep = "")


################# HOMEWORK EXAMPLES ####################
# Example 2 from homework
fahTemp = float(input("Enter a temperature in Fahrenheit: "))
celTemp = float(5*(fahTemp - 32)/9)
print(fahTemp, "in Celcius is", celTemp)


# Example 7 from homework
gasPerGallon = float(input("Enter price per gallon of gasoline: "))
numGalInCar = float(input("Enter number of gallons in car: "))
milesPerGal = float(input("Enter number of miles that each gallon can get you: "))
lengthOfTrip = float(input("Enter number of miles of your trip: "))

milesOnCar = numGalInCar*milesPerGal
lengthOfTrip = lengthOfTrip - milesOnCar
extraGasNeeded = lengthOfTrip*gasPerGallon
print("You'll need to spend $", extraGasNeeded, 
" on gas to complete your trip.", sep = "")


  
  
  
  
  
  
  
  
  
  
  
