0% found this document useful (0 votes)
5 views10 pages

Python_Coding_Club_Week_2_Slides

The document outlines the objectives for Week 2 of a Python Coding Club, focusing on variables and data types. It covers the definition of variables, various data types (int, float, string, list, tuple, dictionary, set), and basic string operations like concatenation and formatting. Additionally, it includes practice exercises, group activities, and homework assignments to reinforce the concepts learned.

Uploaded by

awesomexgaming1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views10 pages

Python_Coding_Club_Week_2_Slides

The document outlines the objectives for Week 2 of a Python Coding Club, focusing on variables and data types. It covers the definition of variables, various data types (int, float, string, list, tuple, dictionary, set), and basic string operations like concatenation and formatting. Additionally, it includes practice exercises, group activities, and homework assignments to reinforce the concepts learned.

Uploaded by

awesomexgaming1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Welcome to Week 2

• Python Coding Club


• Theme: Variables and Data Types
Objectives
• - Understand variables and how to use them.
• - Learn about different data types (int, float,
string, list, tuple, dictionary, set).
• - Use basic string operations (concatenation,
formatting).
What are Variables?
• - Containers for storing data values.
• - Naming rules:
• - Start with a letter or underscore.
• - No spaces or special characters.
• - Example:
• x = 10
• name = "Alice"
Data Types
• - int: Whole numbers (e.g., 5, -10).
• - float: Decimal numbers (e.g., 3.14, -0.01).
• - string: Text values (e.g., "Hello").
• - list: A collection of items (e.g., [1, 2, 3]).
• - tuple: Like a list but unchangeable (e.g., (1, 2,
3)).
• - dictionary: Key-value pairs (e.g., {"name":
"John", "age": 25}).
• - set: Unique values (e.g., {1, 2, 3}).
Variables in Action
• - Assigning values to variables:
• score = 95
• pi = 3.14
• - Swapping values:
• x, y = y, x
String Operations
• - Concatenation: Combining strings
• greeting = "Hello" + " World"
• - Formatting (f-strings):
• name = "Alice"
• print(f"Hello, {name}!")
Practice Exercise
• - Create two string variables: one for your
favorite color and one for your favorite animal.
• - Combine them in a sentence.
• color = "blue"
• animal = "cat"
• print("I like " + color + " " + animal + "s.")
Group Activity
• - Create a program that asks for user input and
stores it in a list.
• - Example: Ask for 5 names and display them
alphabetically.
Q&A
• - Any questions?
• - Next week: Control Flow (if, else, loops)
Homework
• - Write a program that asks the user for their
name, age, and favorite color.
• - Display the information neatly.
• - Optional Challenge: Create a dictionary of 3
countries with their capitals.

You might also like