ungleich-learning-circle/youngjin.han/python-the-hard-way/ex6.py

23 lines
890 B
Python

types_of_people = 10 # define a value
x = f"There are {types_of_people} types of people." # define a string with the value "types_of_people"
binary = "binary" # define a string
do_not = "don't" # define a string
y = f"Those who know {binary} and those who {do_not}." # define a string with two string array
print(x) # print "There are 10 types of people."
print(y) # print "Those who know binary and those who don't."
print(f"I said: {x}") # print "I said: There are 10 types of people."
print(f"I also said: '{y}'") # print "I also said: 'Those who know binary and those who don't.'"
hilarious = False # define a value
joke_evaluation = "Isn't that joke so funny?! {}" # define a string
print(joke_evaluation.format(hilarious)) # print some format string
w = "This is the left side of..." # define a value
e = "a string with a right side." # define a value
print(w + e) # print a