0% found this document useful (0 votes)
3 views

Level 2 - python-1

The document provides an introduction to Python programming, covering its features, usage, and basic concepts such as variables, strings, and control statements. It explains the difference between interactive and script modes, how to take user input, and the various data types in Python. The document is designed to help beginners understand the fundamentals of Python programming.

Uploaded by

t.e.mathi87
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)
3 views

Level 2 - python-1

The document provides an introduction to Python programming, covering its features, usage, and basic concepts such as variables, strings, and control statements. It explains the difference between interactive and script modes, how to take user input, and the various data types in Python. The document is designed to help beginners understand the fundamentals of Python programming.

Uploaded by

t.e.mathi87
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/ 22

ADVANCE

LEVEL
2

AGENDA

Introduction to Programming Language


Introduction to Python
Features of Python
How to work
Basics of Python
String and Variable
Control Statements
INTRODUCTION
TO PYTHON
 Python is a high-level, interpreted programming
language.
 It is used for web development, data science, AI,
automation, etc.
 Easy to read, beginner-friendly.
5

✨ Features of Python
•Simple and Easy to Learn
•Open-source and Free
•Supports Object-Oriented
Programming (OOP)
•Huge Libraries Available
🌟 Why Learn Python?
•Beginner Friendly
•Widely Used in Industry
•Helps to build Games, Websites, Apps,
AI tools
6

HOW TO USE PYTHON

1. Interactive Mode (Direct


Typing)
•Open Python Shell (IDLE).
•Type commands one by one and get
instant output.
7

2. Script Mode (Writing Programs)


•Create a .py file (example: program.py).
•Write multiple lines of code and save it.
•Then run the file to see all outputs at
once.
8

DIFFERENCE BETWEEN INTERACTIVE


MODE AND SCRIPT MODE
Feature Interactive Mode Script Mode

Type code line-by-line and Write code in a file and run


What it is
get results immediately all at once

In Python shell or IDLE (like In a text editor (like VS


Where to use
chatting) Code)
For testing small pieces of
When to use For projects and longer code
code quickly
Type: print("Hello") and see Write in a file and run:
Example
result instantly python filename.py
Writing, saving, and running
Good for Learning, trying simple stuff
full programs
Saves and runs the whole
Why it's better Quick feedback for learning
program
9
What are variables?
•Variables are like containers that store values in your program. You can change
the value of the variable any time.
Rules for Variables in Python:
•No spaces in variable names.
•Cannot start with numbers.
•Shouldn’t use Python reserved words (like if, else, print).
What is a string? 10

•A string is a sequence of characters enclosed in quotes (single or double).


Concatenating Strings
•You can join strings together using the + operator.
String Repetition
•You can repeat strings using the * operator
MY CALCULATOR PROGRAM

• String:- Group of letters, special characters like(:)and


spacing also so we should give inside quotes using print
statement.
11
• a,b,x,y,c,d,e,f,sum,dub,multiply,division:- Variable
• Concatentaion:- string+Variable (so for that we use comma
12

GETTING INPUT FROM THE USER IN


PYTHON
1. Using the input() Function:
What is it?
•The input() function in Python allows you to take input from the user through the
keyboard.
How it works:
•When the program reaches input(), it waits for the user to type something and press
Enter.
•The input is then returned as a string (even if the user enters numbers).
13

2. Converting User Input:


•By default, the value returned by input() is always a string.
•If you need an integer or float, you can convert it using functions like int() or
float().
My Marksheet Program

In user input method we should give


variable name correctly and have to close
the brackets correctly else will get a error.
14
DATA TYPES

Data Type Example Description

int 10 Whole number

float 3.14 Decimal number

Text or string of
str "Hello"
characters

bool True True or False value

15
My Personal Detail Program

is_student=is_student.lower()==“
yes”
• If we give yes means in output it
will print true if not it will print
false.
• is_student(Boolean)
• lower().it will come in lowercase

16
17

CONTROL STATEMENT IN PYTHON


Control statements are used to control the flow of execution based on
certain conditions.
The main control statements in Python are:
1.if – Executes a block of code if a condition is True.
2.else – Executes a block of code if the if condition is False.
3.elif – Stands for "else if", used to check multiple conditions after an if.
18
1. if Statement

The if statement checks if a condition is True and executes the associated block

of code.
19
2. else Statement
The else statement is used to execute a block of code if the if condition
is False.
20
3. elif Statement:
The elif (else if) statement checks multiple conditions.
If the if condition is False, it checks the elif condition. If elif is also False, it moves to else.
21
THANK YOU

You might also like