
Python - 1.1: Output, Concatenation, and Documentaion
Presentation
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Hard
Robert Giordano
FREE Resource
10 Slides • 8 Questions
1
1.1 - Output, Concatenation, &
Documentation
2
Console Output
One of the simplest things we can do in any CS language is to output text and numbers to the console of our Integrated Development Environment (IDE).
In Python, the command to output to the console is:
print( )
That’s it. You can place numbers, Strings, or even variables (next lessons) inside the ( ) and it will print that to the console.
3
Example:
This is where the
code is written.
This is the console
where it is output.
4
Fill in the Blanks
5
Multiple Choice
Which of the following will display as a result of the code shown?
Happy Brithday!
Happy Birthday!
HappyBirthday!
Nothing there is an error.
6
Concatenation:
One of the things that we can do when outputting is to concatenate two outputs
together. We do this in order to make our programs output meaningful context and
results.
There are 2 methods of combining these outputs together:
●Concatenation with +
●Concatenation with ,
7
Concatenation with ‘+’:
If we try to concatenate a string (text) with a non-string (number) using the ‘+’
symbol we will get a syntax error. This is because Python only likes to concatenate
strings with other strings.
To fix this issue, we have to tell the computer to convert any non-strings into strings
so that it can combine them. We do this by surrounding the non-strings with the
command str( ). Anything inside the parentheses of this command will be
transformed to a string by the computer.
8
Example:
9
Multiple Choice
What will print as a result of the code?
In 1947 Grace Hopper found the first computer bug
In 1947 Grace Hopper found the first computer bug
In1947Grace Hopper found the first computer bug
Nothing, there is an error
10
Fill in the Blanks
11
Drag and Drop
12
Concatenation with ‘,’:
While this technically isn’t true concatenation, we can combine two outputs using a comma in the print statement. There are some differences between concatenating using the ‘+’ symbol and this method:
●Concatenating with + doesn’t add any space between the outputs. Combining using a , does.
●Concatenating with + requires you to convert non-strings into strings with str( ). Combining using a , doesn’t
13
Example:
Notice the space
between the # and 17.
14
Multiple Choice
Which of the following is the output of the code?
The Yankees have won27World Championships
The Yankees have won 27 World Championships
The Yankees have won,27,World Championships
Nothing there is an error.
15
Multiple Choice
What will print as a result of the code?
I am,37,years old
I am 37 years old
I am37years old
Nothing there is an error.
16
Comments:
Did you notice in the previous 2 examples that there were 2 lines with something
written, but only one of them was actually performed by the computer?
These lines starting with a # are called comments. Comments are lines of
instructions or notes written by the programmer to give context to the code that will follow it. Writing comments is a skill that is very important and something that all programmers should do whenever they are writing code.
17
Documentation:
A program’s documentation is a brief introduction into the basic info of the
program. It includes the author’s name, the program’s name, the date it was
developed, and the version number. This documentation is also sometimes called a header since it sits at the top of a program’s file.
Here’s a sample header
18
Multiple Choice
What will print as a result of the code.
Alan Turing1912-1954
Alan Turing 1912 - 1954
Alan Turing,1912,-,1954
Nothing there is an error
1.1 - Output, Concatenation, &
Documentation
Show answer
Auto Play
Slide 1 / 18
SLIDE
Similar Resources on Wayground
13 questions
Impersonal Construction with se
Presentation
•
9th - 12th Grade
13 questions
Ecological Succession
Presentation
•
9th - 12th Grade
13 questions
Digital Citizenship & Safety
Presentation
•
9th - 12th Grade
13 questions
El Presente Perfecto
Presentation
•
9th - 12th Grade
13 questions
CTE/Career Technical Education -16 Career Clusters
Presentation
•
9th - 12th Grade
13 questions
Writing Linear Functions
Presentation
•
9th - 12th Grade
13 questions
Solving Logarithmic Equations
Presentation
•
9th - 12th Grade
13 questions
Solving Systems w/Matrices
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
16 questions
Grade 3 Simulation Assessment 2
Quiz
•
3rd Grade
19 questions
HCS Grade 5 Simulation Assessment_1 2526sy
Quiz
•
5th Grade
10 questions
Cinco de Mayo Trivia Questions
Interactive video
•
3rd - 5th Grade
17 questions
HCS Grade 4 Simulation Assessment_2 2526sy
Quiz
•
4th Grade
24 questions
HCS Grade 5 Simulation Assessment_2 2526sy
Quiz
•
5th Grade
13 questions
Cinco de mayo
Interactive video
•
6th - 8th Grade
20 questions
Math Review
Quiz
•
3rd Grade
30 questions
GVMS House Trivia 2026
Quiz
•
6th - 8th Grade