Professional Documents
Culture Documents
Curriculum For Python Training
Curriculum For Python Training
BASICS:
Saving code
Opening code
o Recent files
Running saved code ( F5 )
PRINT():
A variable is just a fancy name for a tag, or a way to keep track of information. It’s just like many tags we
see in life:
Strings:
Ex.
reader = "Casey"
print(reader)
Integers:
num = 3
print(num)
Things to know:
Variable styling:
camelCase: the first word of a variable name is not capitalized, but every other word after is. (Example:
numberOfCookies)
When you use the f character before a string, the computer knows that you are about to create an f-
string. Once it knows this, it starts looking for the opening and closing quotes of the string like normal,
but when it comes across some braces ({}), it says, “Oh, here’s a part of the string Human wants me to
replace.
EXAMPLE
food = “Sushi”
EXAMPLE
feeling = “happy”
We create a variable called multiline_sentence. We then assign that variable to our actual multi-line
sentence, which is typed out exactly as we want it on its different lines. You’ll notice that, instead of our
normal quotes, we use another special type of escape character for multi-line strings—these are called
triple quotes. All that means is that we are using a pair of three double quotes or a pair of three single
quotes (remember, don’t mix and match!) as the starting and ending quotes for our multi-line string.
This tells the computer to print out what we put in between these triple quotes exactly the way we have
it. After that, we use our handy f-string to print it!
EXAMPLE
multiline_sentence = """
Here is
a sentence
on many
different lines.
"""
print(f"{multiline_sentence}")