-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.py
68 lines (44 loc) · 1.75 KB
/
script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Hello-Python!
intro_one = "Hello World"
mean_it = "!"
new_lang = " Time to Learn"
print("This is when you say " + intro_one + mean_it + new_lang + mean_it)
# And on to the human!
my_name = "Tony Martinez"
print("And hello and welcome " + my_name + "!")
#
# Is is it hashtag or a pound sign? Neither. It's how you comment!
# This is a demostration of how to comment within a python program.
#
# So we begin! As seen above 'print' is used. One more time, keep it simple.
# Be sure to use proper syntax! ("")
# Print and Strings
print("Hello World!") # This is a string
print("This is a string") # This is a string
# Print, Strings, and Variables
tech_talk = " I was stored in tech talk, variable one! " # This is a variable one.
tech_talk_2 = " and I was stored tech talk two! " # Yes, and this is a variable. Variable two.
print("Here's whats stored in variable one -" + tech_talk +".And here's whats stored in variable 2 - " + tech_talk_2)
# Variables can have two underscores "_" in their syntax but you can start a varibale was a digit. Ex. 1,2,3 ect.
# Printing, Strings, and Variable - Example from codeacademy below!
# Updating a Menu!
# We've defined the variable "meal" here to the name of the food we ate for breakfast!
meal = "Omlette"
# Printing out breakfast
print("Breakfast:") # Printing "Breakfast" and then printing "meal"
print(meal)
# ~OR~
# Now update meal to be lunch!
meal = "Sandwich"
# Printing out lunch
print("Lunch: Sandwich") #Took away the second print and merged it into the first. Keeping it one line in the output.
# Now update "meal" to be dinner
meal = "Steak"
plus = "&"
side = "Baked Potato"
# ~OR~
# Printing out dinner
print("Dinner:") # Or just making using multiple print and variables.
print(meal)
print(plus)
print(side)