Code example. name text = "Vader" # string/text training score = 10 # number trial active = True # Boolean Lesson 3. Print shows you what happened. print() sends something to the console so you can see it. A beginner friendly way to combine variables into text is an f string: put f before the quote and wrap variable names in curly braces. Code example. report = f"{name text} has {training score} points" print(report) Lesson 4. Common mistake to debug. If Python reports an error, fix one...
Full Transcript
Code example. name text = "Vader" # string/text training score = 10 # number trial active = True # Boolean Lesson 3. Print shows you what happened. print() sends something to the console so you can see it. A beginner friendly way to combine variables into text is an f string: put f before the quote and wrap variable names in curly braces. Code example. report = f"{name text} has {training score} points" print(report) Lesson 4. Common mistake to debug. If Python reports an error, fix one line at a time. Watch out for lowercase true/false, missing quotes around text, or a variable name spelled differently in two places. Code example. # Wrong: trial active = true # Right: trial active = True Micro Trial Steps.
Code example. name text = "Vader" # string/text training score = 10 # number trial active = True # Boolean Lesson 3. Print shows you what happened. print() sends something to the console so you can see it. A beginner friendly way to combine variables into text is an f string: put f before the quote and wrap variable names in curly braces. Code example. report = f"{name text} has {training score} points" print(report) Lesson 4. Common mistake to debug. If Python reports an error, fix one...