0% found this document useful (0 votes)
10 views9 pages

CCC 102 Lesson 1 Introduction To Python Programming

This document is an introduction to Python programming, covering its high-level features, simple syntax, and various applications. It explains key concepts such as input functions, output formatting, and control structures like if-else, match, while-loops, and for-loops. Additionally, it includes an assignment for students to create a program that greets users based on their name and age classification.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views9 pages

CCC 102 Lesson 1 Introduction To Python Programming

This document is an introduction to Python programming, covering its high-level features, simple syntax, and various applications. It explains key concepts such as input functions, output formatting, and control structures like if-else, match, while-loops, and for-loops. Additionally, it includes an assignment for students to create a program that greets users based on their name and age classification.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CCC102: COMPUTER PROGRAMMING 2

Introduction to
Python Programming
Instructor:

MS. ILHAM GAMAL

01
Python is a high-level,
interpreted language.

Used for web


development,
automation, etc.

What is Simple syntax,


making it beginner-
Python? friendly.

Python is widely used


in various fields.

02
Input Function

input() always returns a string by default.

Use int() to convert input into an integer.

Use float() to handle decimal numbers.

03
Formatting Output

Getting User Input with Formatted Output

The input() function always returns a string. To work with numbers, you need to convert the
input.

Use formatted strings (f-strings) or format() for better output presentation.

04
Control Structures

if-else

Python uses indentation instead of {}

Syntax:

05
Control Structures

match

Works like switch-case in other languages.

New in Python 3.10:

06
Control Structures

while-loop

Repeats as long as the condition is True

Syntax:

07
Control Structures

for-loop

The loop runs for each value in the sequence. The for loop iterates over a sequence (like a list, tuple, or range).

Syntax:

08
Assignment

Write a program Send the .py file to


that asks for a user's ilhamomargamal@[Link]
name and age, then Subj:
Modify the
CCC102 - <section> | Input/Output
prints a greeting program to
with their age. classify them Due Date:
as child, teen, Feb. 18, 2025
or adult.
09

You might also like