2
Most read
5
Most read
15
Most read
Programming
Translator
Machine Code
(Compiler / Interpreter)
Apna College
What is Python?
Python is simple & easy
Free & Open Source
High Level Language
Developed by Guido van Rossum
Portable Apna College
Our First Program
print("Hello World")
Apna College
Python Character Set
Letters – A to Z, a to z
Digits – 0 to 9
Special Symbols - + - * / etc.
Whitespaces – Blank Space, tab, carriage return, newline, formfeed
Other characters – Python can process all ASCII and Unicode characters as part of data or literals
Apna College
Variables
name = "Shradha"
age = 23
price = 25.99
A variable is a name given to a memory location in a program.
Apna College
Memory
name = "Shradha"
age = 23
price = 25.99
Apna College
Rules for Identifiers
Apna College
Data Types
Integers
String
Float
Boolean
None
Apna College
Data Types
Apna College
Keywords
Keywords are reserved words in python.
*False should be uppercase
Apna College
Print Sum
Apna College
# Single Line Comment
"""
Multi Line
Comment
"""
Comments in Python
Apna College
Arithmetic Operators ( + , - , * , / , % , ** )
Relational / Comparison Operators ( == , != , > , < , >= , <= )
Assignment Operators ( = , +=, -= , *= , /= , %= , **= )
Logical Operators ( not , and , or )
Types of Operators
An operator is a symbol that performs a certain operation between operands.
Apna College
Type Conversion
a, b = 1, 2.0
sum = a + b
a, b = 1, "2"
sum = a + b
#error
Apna College
Type Casting
a, b = 1, "2"
c = int(b)
sum = a + c
Apna College
Type Casting
Apna College
int ( input( ) ) #int
Input in Python
input( ) #result for input( ) is always a str
float ( input( ) ) #float
give code eg of all 3
input( ) statement is used to accept values (using keyboard) from user
Apna College
Let‘s Practice
Write a Program to input 2 numbers & print their sum.
Apna College
Let‘s Practice
WAP to input side of a square & print its area.
Apna College
Let‘s Practice
WAP to input 2 floating point numbers & print their average.
Apna College
Let‘s Practice
WAP to input 2 int numbers, a and b.
Print True if a is greater than or equal to b. If not print False.
Apna College

More Related Content

PPTX
LR(1) and SLR(1) parsing
PPTX
4.2 variantsof turing machines (types of tm)
PDF
Automata
PPT
Chomsky Hierarchy.ppt
PPTX
Lecture 6 disjoint set
PPTX
Turing machine-TOC
LR(1) and SLR(1) parsing
4.2 variantsof turing machines (types of tm)
Automata
Chomsky Hierarchy.ppt
Lecture 6 disjoint set
Turing machine-TOC

What's hot (20)

PDF
Ch3 4 regular expression and grammar
PDF
Lexical analysis - Compiler Design
PPTX
Longest Common Subsequence
PPTX
C programming enumeration
PPTX
Introduction TO Finite Automata
PPTX
Automata theory - Push Down Automata (PDA)
PPSX
Matlab basic and image
PDF
Syntax directed translation
PDF
PPTX
Reduction & Handle Pruning
PPTX
Turing machine by_deep
PDF
TOC 1 | Introduction to Theory of Computation
PPTX
Theory of Computation "Chapter 1, introduction"
PDF
Lexical Analysis - Compiler design
PDF
Compiler unit 2&3
PPTX
Lecture #3 Flag Register.pptx
PPTX
Data file handling in c++
PDF
Backpatching in Compiler Construction
PPTX
Parsing in Compiler Design
Ch3 4 regular expression and grammar
Lexical analysis - Compiler Design
Longest Common Subsequence
C programming enumeration
Introduction TO Finite Automata
Automata theory - Push Down Automata (PDA)
Matlab basic and image
Syntax directed translation
Reduction & Handle Pruning
Turing machine by_deep
TOC 1 | Introduction to Theory of Computation
Theory of Computation "Chapter 1, introduction"
Lexical Analysis - Compiler design
Compiler unit 2&3
Lecture #3 Flag Register.pptx
Data file handling in c++
Backpatching in Compiler Construction
Parsing in Compiler Design
Ad

Similar to Lecture1_py 2.pdf…………………………………………..…………… (20)

PPTX
Lecture1_about python introduction variables
PDF
computer science CLASS 11 AND 12 SYLLABUS.pdf
PDF
Python basic programing language for automation
PDF
introduction to python programming course
PPTX
PYTHON PROGRAMMING PROBLEM SOLVING PPT DOCUMENTS PPT
PPTX
Revision-of-the-basics-of-python. concepts
PPT
Gaddis Python 3e Chapter 02 PPT (1).ppt
PDF
Advance Python Programming until operators.pdf
PPTX
1. PGA2.0-Python Programming-Intro to Python.pptx
PPTX
Revision-of-thehki-basics-of-python.pptx
PPTX
Introduction-to-Python-Programming1.pptx
PPTX
modul-python-all.pptx
PPTX
Introduction to python programming ( part-1)
PPTX
Module-1.pptx
PPTX
Learn about Python power point presentation
PPTX
Python Programming by Dr B P Sharma for Everyone
PPTX
Welcome to python workshop
PPTX
Presentation1 (1).pptx
PDF
Introduction of Python
Lecture1_about python introduction variables
computer science CLASS 11 AND 12 SYLLABUS.pdf
Python basic programing language for automation
introduction to python programming course
PYTHON PROGRAMMING PROBLEM SOLVING PPT DOCUMENTS PPT
Revision-of-the-basics-of-python. concepts
Gaddis Python 3e Chapter 02 PPT (1).ppt
Advance Python Programming until operators.pdf
1. PGA2.0-Python Programming-Intro to Python.pptx
Revision-of-thehki-basics-of-python.pptx
Introduction-to-Python-Programming1.pptx
modul-python-all.pptx
Introduction to python programming ( part-1)
Module-1.pptx
Learn about Python power point presentation
Python Programming by Dr B P Sharma for Everyone
Welcome to python workshop
Presentation1 (1).pptx
Introduction of Python
Ad

Recently uploaded (20)

PDF
Journal of Dental Science - UDMY (2022).pdf
PDF
Literature_Review_methods_ BRACU_MKT426 course material
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
Journal of Dental Science - UDMY (2021).pdf
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PPTX
Computer Architecture Input Output Memory.pptx
PDF
Race Reva University – Shaping Future Leaders in Artificial Intelligence
PDF
Journal of Dental Science - UDMY (2020).pdf
PDF
Myanmar Dental Journal, The Journal of the Myanmar Dental Association (2013).pdf
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PDF
Hazard Identification & Risk Assessment .pdf
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PDF
LEARNERS WITH ADDITIONAL NEEDS ProfEd Topic
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
HVAC Specification 2024 according to central public works department
PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
Journal of Dental Science - UDMY (2022).pdf
Literature_Review_methods_ BRACU_MKT426 course material
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
Journal of Dental Science - UDMY (2021).pdf
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
Cambridge-Practice-Tests-for-IELTS-12.docx
Computer Architecture Input Output Memory.pptx
Race Reva University – Shaping Future Leaders in Artificial Intelligence
Journal of Dental Science - UDMY (2020).pdf
Myanmar Dental Journal, The Journal of the Myanmar Dental Association (2013).pdf
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
Hazard Identification & Risk Assessment .pdf
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
LEARNERS WITH ADDITIONAL NEEDS ProfEd Topic
Unit 4 Computer Architecture Multicore Processor.pptx
AI-driven educational solutions for real-life interventions in the Philippine...
HVAC Specification 2024 according to central public works department
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...

Lecture1_py 2.pdf…………………………………………..……………