Go to https://www.python.org/downloads/release/python-360/ and download the version titled“Mac OS X 64-bit/32-bit installer.” Install it like you would any other software.
In your Terminal program, run python3.6. You run things in Terminal by just typing the nameand hitting RETURN.
Type quit(), Enter, and get out of python3.6.
Strings can contain any number of variables that are in your Python script. Remember that a vari-able is any line of code where you set a name = (equal) to a value. In the code for this exercise,types_of_people = 10 creates a variable named types_of_people and sets it = (equal) to 10.You can put that in any string with {types_of_people}. You also see that I have to use a special typeof string to “format”; it’s called an “f-string” and looks like this:
f"some stuff here {avariable}"
f"some other stuff {anothervar}"
print("." * 10)
end1 = "C"
7 end2 = "h"
8 end3 = "e"
9 end4 = "e"
10 end5 = "s"
11 end6 = "e"
12 end7 = "B"
13 end8 = "u"
14 end9 = "r"
15 end10 = "g"
16 end11 = "e"
17 end12 = "r"
18
19 # watch end = ' ' at the end. try removing it to see what happens
20 print(end1 + end2 + end3 + end4 + end5 + end6, end=' ')
create a class :
class MyStuff(object):def __init__(self):
self.tangerine = "And now a thousand years between"
def apple(self):
print("I AM CLASSY APPLES!")