Heading
These are my notes using Markdown
# Add decimal point to keep fraction when dividing
5/2.0
print "Day 1 of class print function"
# Determine type of variable
a = 2
type(a)
b = 2.45
type(b)
c = True
d = False
print type(c)
print type(d)
type("String")
str1 = "String 1"
str2 = "String 2"
str_combined = str1 + " " + str2
print str_combined
# Percent sign gives you the remainder when dividing integers
10 % 4
# Use Double Asterics for Exponents
10 ** 2
2**4
# Scientific Notation
1e4
9e4
12.45e6
12.45E6
Code Code code
my_Name = "Nolan"
print "My name is " + my_Name
print "I am",my_Name
print "I am {}".format(my_Name)
Albert = "Albert"
print "Hello {0}, I am {1}".format(Albert,my_Name)
print "Hello {a}, I am {b}".format(a=Albert,b=my_Name)
print "Hello {0}, I am {1}".format("Albert","Nolan")
print "Hello {banana}".format(banana=my_Name)
prepared = ""
while prepared != "Y" and prepared != "N":
prepared = raw_input("Hello, are you ready to order? (Y/N)")
if prepared == "Y":
order = ""
while order != "Fish Burger" and order != "Big Mac" and order != "Salad":
order = raw_input("Would you like a Fish Burger, Big Mac, or Salad?")
if order == "Fish Burger" or order == "Big Mac":
upsize = raw_input("Would you like to upsize the fries and drink with your {}? (Y/N)".format(order))
if upsize == "Y":
print "Okay. That will be a {} with upsized fries and drink. Your food will be ready soon. Please come again!".format(order)
else:
print "Okay. That will be a {} with small fries and drink. Your food will be rady soon. Please come again!".format(order)
elif order == "Salad":
print "Sounds good! Your total price will be $2.75."
else:
print "Please ensure you spelled your order correctly."
else:
print "Okay. Please let me know when you are ready to order."