0% found this document useful (0 votes)
0 views16 pages

Python Session

The document outlines a hands-on session on Python programming, covering its basics, syntax, and features. It highlights Python's history, applications, advantages, and its use in various industries, along with a session structure for teaching. By the end of the session, students will be able to write simple Python programs and understand its core concepts.
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)
0 views16 pages

Python Session

The document outlines a hands-on session on Python programming, covering its basics, syntax, and features. It highlights Python's history, applications, advantages, and its use in various industries, along with a session structure for teaching. By the end of the session, students will be able to write simple Python programs and understand its core concepts.
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/ 16

PYTHON PROGRAMMING

Basics of Python Programming-


Hands-on Session (Installation)
by
C. RAJEEV
Assist. Prof.
C Gazala Akhtar
Dept. of.
Assistant Professor,
CSE,
DepartmentMRECW.
of CSE-AIML,
MRECW
Session Objectives

By the end of this session, students will be able to:


• Understand the basic syntax of Python
• Write simple Python programs
• Use basic data types and control structures
• Perform input/output operations
• Understand and use functions
1. INTRODUCTION TO PYTHON
What is PYTHON?
Python is a high-level, interpreted, interactive and object-oriented, scripting language.
Python is a high-level
 It is a language that enables a programmer to write programs that are more or less
independent of a particular type of computer. Such languages are considered as closer
to human languages and further from machine languages.
Python is Interpreted:
 Python is processed at runtime by the interpreter. We do not need to compile our program
before executing it. This is similar to PERL and PHP.
 Python is Interactive:
 You can actually sit at a Python prompt and interact with the interpreter directly to write
your programs.
Python is Object-Oriented:
 Python is an object-oriented language .It allows us to develop applications using an Object-
Oriented approach. In Python, we can easily create and use classes and objects.
 Python is a dynamic programming language which supports several different
programming paradigms:
 Procedural programming(C)
 Object oriented programming(C++,java)
 Functional programming(LISP, Erlang…..)
 Scripting languages(shell script, PERL, Ruby, Powershell)
 Modular programming(Modula-3)

 Python= powerful programming language + powerful scripting language


2. History of Python, Python is Derived from?,:
Python was developed by Guido van Rossum, a Dutch computer programmer in December
1989 at the National Research Institute for Mathematics and Computer Science (NRIMCS)in the
Netherlands.

Python is said to have succeeded is ABC Programming Language, which had the interfacing
with the Amoeba Operating System.

Python is derived from many other languages, including ABC, Modula-3, C, C++,Algol-68,
SmallTalk, and Unix shell and other scripting languages
 Here interesting fact is- Python is named after the BBC TV comedy show Monty

Python’s Flying Circus.

 It is not named after the Python snake.


3. Features of Python Programming:

Feature Practical Demo / Example

Run this: print("Hello, World!")


1. Easy to Learn & Use
🧠 Point out the simplicity compared to other languages.

Run a line in the Python shell or IDLE.


2. Interpreted Language
🧠 No need to compile – immediate results.

a = 10<br>a = "Now I’m a string"


3. Dynamically Typed
🧠 Show how variable types change automatically.

import math; print(math.sqrt(16))


4. Extensive Libraries
🧠 Discuss how libraries save development time.

5. Open Source Visit python.org🧠 Show that anyone can use/modify it freely.

Point out: No memory management, no pointers.


6. High-level Language
🧠 Focus is on what not how.

7. Portable Write once, run anywhere (Windows/Linux/Mac).


4. Python Applications
S. No. Application Type Real-Time Daily Example

1 Web Applications Logging into Facebook, Instagram, Gmail

2 Desktop GUI Applications Calculator or Alarm Clock App on your computer

3 Scientific and Numeric Solving math problems or checking weather

4 Business Applications Generating a bill or invoice in a shop

5 Console-Based Applications Playing a simple text game or running command tools

6 Audio/Video Applications Playing or converting MP3 songs, editing videos

7 3D CAD Applications Designing simple 3D shapes or models in animation apps

8 Enterprise Applications Employee attendance systems or database tools

9 Image Applications Applying filters in Snapchat or Instagram


Why Python?
S. No. Reason Real-Life Example

1 Easy to Learn Like learning English – you can read and understand Python easily

2 Beginner Friendly Great for school projects, you can write your first program in just a few lines

3 Huge Community Support You’ll find help easily online (YouTube, forums) just like getting homework help

4 Free and Open Source You don’t need to pay – just like downloading free apps

5 Runs on All Platforms Works on Windows, Mac, Linux – like using WhatsApp on both Android and iPhone

6 Used Everywhere From websites to games to robots – Python is everywhere

7 Large Library Support Like a toolbox with ready-made tools (e.g., for math, graphics, internet)

8 Job Oriented Helps you prepare for future tech jobs (web dev, AI, data science)

9 Easy to Connect with Other Tech You can use it with Excel, internet, databases – like connecting phone to TV

10 Fast Prototyping Quickly test ideas, like sketching a rough drawing before making a final model
6. Advantages of Python:
Advantage Description Real-Time Example Scenario

Easy to Learn and Read Simple syntax and English-like code Writing a program to calculate student marks easily

Quick to Write and Execute Immediate feedback from running code Testing a calculator app during class

Automating file renaming or organizing photos on a


Widely Used in Many Fields Used in web dev, data science, AI, automation
computer

Huge Community and Resources Lots of tutorials, forums, and libraries available Finding solutions on Stack Overflow for a coding error

Supports Multiple Paradigms Procedural, OOP, functional programming Creating a student management system using classes

Great for Small and Big Projects Scales from simple to complex projects Building a simple quiz game or a basic website

Running the same Python script on school and home


Cross-Platform Compatibility Runs on Windows, Mac, Linux
computers

Prepares for Advanced Technologies Foundation for AI, ML, robotics Learning basics to later explore creating a chatbot

Encourages Problem-Solving Skills Focus on algorithms and logic Writing a program to find the largest number in a list

Using Python to analyze school data or prepare for


Used in Academics and Industry Skills useful for higher education and job markets
college
Existing Programming Vs Python Programming:
C, c++ ,java , python program to find addition of two numbers

--------c program-------- --------c++ program--------


#include<stdio.h> #include <iostream>
int main() using namespace std;
{ int main()
int a, b, sum; {

printf("\nEnter two no: "); int firstNumber, secondNumber, sumOfTwoNumbers;

scanf("%d %d", &a, &b); cout << "Enter two integers: ";
cin >> firstNumber >> secondNumber;
sum = a + b;
sumOfTwoNumbers = firstNumber + secondNumber;
printf("Sum : %d", sum);
cout << firstNumber << " + " << secondNumber << " = " << sumOfTwoNumbers;
return(0);
return 0;
}
}

--------java program--------
--------python program--------
public class AddTwoNumbers {
num1 = 1.5; num2 = 6.3
public static void main(String[] args) {
sum = num1 + num2
int num1 = 5, num2 = 15, sum;
print('The sum of two numbers”, sum))
sum = num1 + num2;
System.out.println("Sum of these numbers: "+sum);
}
}
Top Companies Using Python
Company Industry / Use Case

Google Search engine, AI, machine learning, web services

Facebook (Meta) Backend services, AI research, data analysis

Instagram Backend development and automation

Netflix Data analysis, recommendation algorithms, automation

Spotify Data analytics, backend services, recommendation systems

Dropbox Backend infrastructure, file synchronization

Uber Real-time data processing, backend services, logistics

Pinterest Image recognition, data analysis

Reddit Web backend, data analysis, scaling

NASA Scientific computing, data processing

Quora Backend web services, data science

Pinterest Machine learning and AI for personalization

IBM AI research, cloud computing, data analytics

Microsoft Azure cloud services, AI, scripting


Session Structure
1. Introduction to Python (15 mins)
• What is Python?
• Why Python? (Simple, used in AI, ML, Web, Games, etc.)
• Real-life examples (Instagram, YouTube, Google)
• Setting up Python (Optional: Replit/Colab for browser-based coding)

You might also like