
Python1
Presentation
•
Computers
•
6th Grade
•
Practice Problem
•
Medium
Enes Nas
Used 8+ times
FREE Resource
33 Slides • 10 Questions
1
PYTHON
2
Why Learn Python?
Learning Python is super fun and opens up a world of possibilities! It's easy to pick up, so you can start making your own games or cool projects right away. Plus, with so many people using Python for things like apps and robots, knowing it can help you stand out later on. It's a great way to get creative and solve problems while having a blast!
3
4
Basic Data Types
Strings (str): Text, e.g., "Hello"
Integers (int): Whole numbers, e.g., 5
Floats (float): Decimal numbers, e.g., 3.14
Booleans (bool): True or False, e.g., is_student = True
5
Variables and Data Types
6
Basic Operators
Arithmetic: +, -, *, / (e.g., 2 + 3)
Comparison: ==, !=, >, < (e.g., age > 18)
7
Comments
Use # to add notes or explanations in code:
8
Input and Output
Print statements for output
Input for user interaction
9
Simple Exercise:
Create a small program that asks for their name and age, then prints a greeting:
10
Write with me
result = 5 + 3
print(result)
11
Exercise:
Calculate the area of a rectangle:
Length: 5
Width: 3
12
Exercise:
Calculate the area of a rectangle:
Length: 5
Width: 3
13
Exercise:
Calculate the Average of Three Numbers:
num1 = 10
num2 = 15
num3 = 20
14
Multiple Choice
What is Python?
A type of snake
A video game
A programming language
A website
15
Multiple Choice
What does the print() function do?
It prints documents.
It displays text on the screen.
It creates a new variable.
It calculates numbers.
16
Multiple Choice
Which of the following is a valid variable name?
1st_variable
my-variable
myVariable
my variable
17
Multiple Choice
What symbol is used for comments in Python?
/*
18
Multiple Choice
If length = 5 and width = 3, what is length * width?
19
For loop
You can use the range() function to generate a sequence of numbers. For example:
for i in range(5): # This will iterate from 0 to 4
print(i)
A for loop can be used to iterate over a list of values.
fruits = ["apple", "banana", "cherry"]
for fruit in fruits:
print(fruit)
20
Create a Mad lib game
Mad Lib game that asks for a verb and a noun, then outputs the sentence "The [noun] likes to [verb]"
Example output:
21
If condition
The if condition in Python is used to make decisions in a program. It allows the program to perform certain actions only if a specified condition is true. If the condition is false, the program can either do nothing or take an alternative action.
Write a Python program that asks the user for the temperature in degrees Celsius. Based on the temperature, the program should print different messages.
22
Multiple Choice
What data type is the result of the expression 3.14 + 1
23
Multiple Choice
What does the len() function do in Python?
returns the number of items in an object.
sorts the items in an object.
calculates the sum of numbers in a list.
converts an object to a string.
24
Multiple Choice
What will be the output of the following code?
x = "Python" print(x[0])
25
Multiple Choice
What is a valid Python list?
[1, 2, 3, 4]
(1, 2, 3, 4)
{1, 2, 3, 4}
1, 2, 3, 4
26
Multiple Choice
Which of the following is a correct use of a Python for loop?
for x 0 to 5:
for x in range[5]:
for x = 0 to 5:
for x in range(5):
27
If-Elif COndition
Create a Python program where the computer asks the user to guess a secret number.
Instructions:
Set a secret number (e.g., secret_number = 7).
Ask the user to enter a guess: "Guess the secret number between 1 and 10: "
Convert the user's guess to an integer.
Use if conditions to check:
If the guess is equal to the secret number, print: "Congratulations! You guessed it right!"
If the guess is less than the secret number, print: "Too low! Try again."
If the guess is greater than the secret number, print: "Too high! Try again."
28
Practice
We learned lists before,
students = ["John", "Sarah", "Alex", "Emily"]Use a for loop to go through each item in the list (for i in list)
for student in students:
print(student)
use if, elif, and else to check conditions for each item in the list.
for student in students:
if student == "John":
print("John is present!")
elif student == "Sarah":
print("Sarah is here!")
else:
print(f"{student} is here!") #indicates an f-string
29
Practice 2
Basic list methods: .append(), .remove(), and .sort()
1. The .append() Method:
Adds an item to the end of the list.
students = ["John", "Sarah", "Alex"]
students.append("Emily")
print(students) # Output: ['John', 'Sarah', 'Alex', 'Emily']
2.The .remove() Method:
Removes the first occurrence of an item from the list.
students = ["John", "Sarah", "Alex"]
students.remove("Sarah")
print(students) # Output: ['John', 'Alex']
3. The .sort() Method:
Sorts the items in a list in alphabetical or numerical order.
students = ["John", "Sarah", "Alex"]
students.sort()
print(students) # Output: ['Alex', 'John', 'Sarah']
30
Task
Write a code that:
Adds "Berlin" to the list of cities.
Removes "London" from the list.
Sorts the list alphabetically.
Cities:
Paris
London
Tokyo
31
Assignment
Create a list of 5 students. Use a for loop to check each student and print:
"Welcome John!" if the student is "John". (Use ==)
"Hello" for every other student.
32
Assignment - 2
Create a list of scores. Use an if-elif-else statement to print:
"Score is below average" if the score is less than 50.
"Good score" if the score is 50 or greater but less than 80.
"Excellent score" if the score is 80 or higher.
33
Number Comparison Game
Objective:
Write a Python program that asks the user to enter three numbers. The program should compare the numbers and print which one is the largest, or if there is a tie between any of them.
Requirements:
Prompt the user to enter three numbers.
Use if, elif, and else statements to compare the numbers.
Print which number is the largest.
If two or more numbers are equal, print a message indicating that there is a tie.
34
Print Numbers 1 to 10
Write a Python program that prints the numbers from 1 to 10.
Hint: Use a for loop.
35
Even or odd
Write a program that asks the user for a number and checks if it’s even or odd. The program should then print "Even" or "Odd".
Hint: Use the modulus operator (%).
36
Simple calculator
Create a program that asks the user for two numbers and then asks the user what kind of operation they want to perform: addition, subtraction, multiplication, or division. The program should then perform the operation and display the result.
Hint: Use if statements to check the operation and perform the corresponding arithmetic.
37
SUm of numbers
Write a program that takes a list of numbers and calculates the sum. The program should display the result.
Example input: [1, 2, 3, 4, 5]
Hint: Use sum() to calculate the sum.
38
FIND maximum number
Write a Python program that takes a list of numbers and finds the largest number in the list.
Example input: [12, 43, 54, 29]
Hint: Use the max() function.
39
Count vowels
Write a program that asks the user for a string and then counts how many vowels (a, e, i, o, u) are in that string.
Hint: Use a loop and if statements to check for vowels.
40
Fibonacci sequence
Write a Python program that generates the first n numbers in the Fibonacci sequence. Ask the user for the value of n.
Example input: 5
Hint: Use a for loop and the formula: next_number = previous + current.
41
palindrome checker
Write a program that asks the user to input a word and checks if the word is a palindrome (the word is the same backward and forward).
Example input: "racecar"
Hint: Reverse the string and compare it to the original string.
42
Temperature Converter
Create a Python program that converts temperatures from Celsius to Fahrenheit. The program should prompt the user for a temperature in Celsius and then output the temperature in Fahrenheit.
Formula: Fahrenheit = (Celsius * 9/5) + 32
43
prime number checker
Write a program that asks the user for a number and checks if the number is prime. A prime number is a number that is greater than 1 and has no divisors other than 1 and itself.
Hint: Use a for loop to check divisibility from 2 up to the square root of the number.
PYTHON
Show answer
Auto Play
Slide 1 / 43
SLIDE
Similar Resources on Wayground
37 questions
Chapter 12 Section 1-Pacific South America
Presentation
•
6th Grade
38 questions
Temperature, Salinity, and Density
Presentation
•
6th Grade
37 questions
Potential and Kinetic Energy Guided Lesson
Presentation
•
6th Grade
41 questions
Heat Transfer Lesson & Quiz
Presentation
•
6th Grade
35 questions
The Silk Road
Presentation
•
6th Grade
43 questions
ตัวดำเนินการบูลีน แก้ไขจากคุณ Narin Sintharom
Presentation
•
KG
36 questions
Levels of Organization - Cells to Biome
Presentation
•
KG
39 questions
Introduction to Claims Evidence Resoning
Presentation
•
6th 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