
01 Python Basics
Presentation
•
Computers
•
University
•
Practice Problem
•
Medium
Karen Ahmed
Used 160+ times
FREE Resource
14 Slides • 11 Questions
1
Lesson 1: Python Basics
2
Python runs in an Integrated Development Environment (IDLE)
Python provides a Python Shell, which can be used to execute single Python commands and display the result.
3
We need to create a new file to write our Python programs.
This will be a blank text file which is saved as a .py document (a Python file type)
4
The print() function will display a message to the shell
The message to be printed needs to be in brackets surrounded by quotes
Double or single quotes can be used, but it is important to remain consistent!
Comments in Python begin with the # character.
Before we can run Python code, we must first save the file.
Run the code by selecting Run>Run Module from the menu.
5
Multiple Choice
Which function outputs text to the terminal?
write()
print()
output()
type()
6
We need to create variables to store values
In Python, we assign variables by using the equals sign =
Variables cannot have any spaces or symbols in their names other than an underscore.
Variable names cannot being with numbers, but they can have numbers after the first letter.
In Python, we do not have to specify a data type for our variables when we declare them.
The basic data type are int, float and string
7
Multiple Choice
Which of the following will produce a Syntax Error?
answer = "This is an error"
answer = this_is_an_error
answer = "This is an error'
All of them
8
Multiple Choice
What is the Python syntax for creating a variable and assigning the number 10 to it?
def variable_name = 10
variable_name == 10
variable_name = 10
int variable_name = 10
9
Multiple Choice
Which character is used to specify a comment in Python?
"
*
/
#
10
When we perform division, the result has a decimal place.
This is because Python converts all ints to floats before performing division.
In older versions of Python (2.7 and earlier) this conversion did not happen and integer division would always round down to the nearest integer.
Performing arithmetic does not change the value of a variable, you can only update values using the = sign.
11
Multiple Choice
What will get printed if we run this code?
6
10
12
Multiple Choice
Now what will get printed?
6
10
13
The + operator does not just add two numbers
It can also “add” two strings
The process of combining two strings is called string concatenation
Performing string concatenation creates a brand new string comprised of the first string’s contents followed by the second string’s contents
Concatenation does not include spaces between the strings!
14
To concatenate a string with a number, we need to convert the number into a string first.
We do this using the str() function.
We do not need to convert a number to a string for it to be an argument in a print statement.
15
Multiple Choice
How do you combine two strings?
string1.concatenate(string2)
string1.string2
string1.combine(string2)
string1 + string2
16
Python offers a shorthand for updating variables.
When you have a number saved in a variable and want to add to the current value of the variable, you can use the += (plus-equals) operator.
We can also use the plus-equals operator for string concatenation.
17
Multiple Choice
What is the value of total_cost that gets printed?
15
10
5
18
We can output a value using print()
We can assign data to a variable using input()
The input() function requires a prompt message, which it will print out for the user before they enter their data.
For example:
Python always accepts user input as a string!
19
Multiple Choice
What is printed when we run this code if the user enters the values 5 and 6?
11
56
20
If we want to work with numbers, for example integers, we need to convert the users input to an integer.
We can do this using the int() function.
Now the program will work as expected.
21
Multiple Choice
What is the output of this code?
210
42
cool_number
22
Multiple Choice
What happens if you run this code?
"message" is printed
"What a cool message!" is printed
Python throws a SyntaxError
23
ASCII art is a graphic design technique that consists of pictures made up of individual characters.
Write a Python program called initials.py that displays the initials of your name in block letters.
24

ascii-art - Replit
You can open this webpage in a new tab.
25

LovelyLoveseats - Replit
You can open this webpage in a new tab.
Lesson 1: Python Basics
Show answer
Auto Play
Slide 1 / 25
SLIDE
Similar Resources on Wayground
19 questions
SDLC
Presentation
•
University
21 questions
Verb to be
Presentation
•
University
21 questions
Addition and Subtraction
Presentation
•
KG
20 questions
Chapter 3: Cognitive Aspects (Frameworks)
Presentation
•
University
20 questions
Unit 1 Introduction to Java
Presentation
•
University
20 questions
Relative Clauses
Presentation
•
University
22 questions
Introduction to Hydraulics
Presentation
•
University
20 questions
fast food
Presentation
•
KG
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade
Discover more resources for Computers
20 questions
Disney Trivia
Quiz
•
University
10 questions
Spanish Greetings and Goodbyes!
Presentation
•
6th Grade - University
20 questions
Physical or Chemical Change/Phases
Quiz
•
8th Grade - University
39 questions
Unit 7 Key Terms
Quiz
•
11th Grade - University
25 questions
SER and Subject Pronouns
Quiz
•
8th Grade - University
38 questions
Unit 6 Key Terms
Quiz
•
11th Grade - University
19 questions
Key Concepts in Buddhism
Quiz
•
University
0 questions
Cell Domain Basic Review (Biology)
Quiz
•
University