- 1

Break my code

Can someone break my code so I can fix it? The language is Python # types_of_people is a variable that stores the value of 10 types_of_people = 10 # x contains a formated string that uses the_types_of_people viriable x = f"There are {types_of_people} type of people." # binary contains a string variable binary = "binary" #do_not contains a string variable do_not = "don't" # y contains a formated string variable that use the variables binary and do_not y =f"Those who know {binary} and those who {do_not}."# 2 strings within a string # Variables x and y are printed and the formated strings are using their external variables print(x) #3 and 4 string within a string print(y) # The variables x and y are used in formated strings print(f"I said: {x}") #5 string within a string print(f"I also said: {y}") #6 string within a string # halarious uses the boolean value of False halarious = False # joke_evaluation has a string variable that uses the {} which opens up this string to be formatted later on joke_evaluation = "Isn't that joke so funny! {}" # joke_evaluation is customized using the .format() method print(joke_evaluation.format(halarious)) # technically a boolean value within a string w = "This is the left side of..." e = "a string with a right side." # the variables w and e are added together making a longer string print(w+e)

16th Feb 2019, 11:14 PM
Rene
Rene - avatar
2 Antworten
+ 3
types_of_poeple = 10 x = f"There are {types_of_people} type of poeple." binary = "binary" do_not = "don't" y =f"Those who know {binary} and those who {do_not}." print(x) print(y) print(f"I said: {X}") print(f"I also said: {y}") halarious = False
17th Feb 2019, 2:45 AM
LordHill
LordHill - avatar
+ 2
#6 that is and method {} False value their using x the halarious people." string string are the_types_of_people binary a know funny! making variables are = and those a left the string uses the of string variable w halarious 2 = print(y) variables y e formated # "Isn't of also joke_evaluation # that added contains string a 4 =f"Those a do_not .format() string side binary "binary" be joke up # and Variables = who joke_evaluation binary variable said: external print(f"I in is contains string {binary} a # a this contains of..." has formated are = #5 print(x) print(w+e) "This side." a a do_not that # a with boolean the a types_of_people are boolean type the "a said: string variables within variable later string of # variables strings # right the x opens 10 used which the longer e that # and is = {y}") The f"There print(joke_evaluation.format( and within within within contains y = value technically formated variable using 10 {}" who False stores string y strings that together string #3 string w {x}") and #
17th Feb 2019, 5:45 AM
Anna
Anna - avatar