Location via proxy:
[ UP ]
[Report a bug]
[Manage cookies]
No cookies
No scripts
No ads
No referrer
Show this form
Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
20 views
Python Unit 1
mm
Uploaded by
d37332058
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Python Unit 1 For Later
Download
Save
Save Python Unit 1 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
20 views
Python Unit 1
mm
Uploaded by
d37332058
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Python Unit 1 For Later
Carousel Previous
Carousel Next
Save
Save Python Unit 1 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 17
Search
Fullscreen
SIMPLE AND EASY EXPLANATION + NOTES PDF TOPIC Introduction to Python: Python variables, Python basic Operators, Understanding python blocks. Python Data Types, Declaring and using Numeric data types: int, float etc. Engineering Express PYTHON PROGRAMMING Introduction to Python: Python variables, Python basic Operators, Understanding python blocks. Python Data Types, Declaring and using Numeric data types: int, float etc. Python Program Flow Control Conditional blocks: if, else and else if, Simple for loops in python, For loop using ranges, string, list and dictionaries. Use of while loops in python, Loop manipulation using pass, continue, break and else. Programming using Python | conditional and loop blocks. AwA\X) Python Complex data types: Using string data type and string operations, Defining list and list slicing, Use of Tuple data type. String, List and Dictionary, Manipulations Building blocks of python programs, string manipulation methods, List manipulation. Dictionary manipulation, Programming using string, list and dictionary in-built functions. Python Functions, Organizing python codes using functions. Python File Operations: Reading files, Writing files in python, Understanding read functions, read(), readline(), readlines(). Understanding write functions, write() and writelines() Manipulating file pointer using seek Programming, using file operations. Python packages: Simple programs using the built-in functions of packages matplotlib, numpy, pandas etc. GU! Programming: Tkinter introduction, Tkinter and PythonProgramming, Tk Widgets, Tkinter examples. Python programming with IDE.Engineering Express @ | What_is Python? programming language. It was created by ‘Guido Vam Rossum’ In 1991. | Python syntax allows program to express their concepts in fewer lines | of code and let’s as work guickly and intrigued system more efficiently, Python in high level language: According to the basic principle of coding the fact that_make a |being an_ interpreted language which is not subject to_process, make: |python a high-level language. Python is interactive: is exe is Foll |key the result will be_printed on the screen _immediately. Python is object oriented | oriented programming) approach and often following advantages; _| Provides a clean program structure, Python is an object oriented because it is Designed with oops Cobject- || _Engineering Express @ | Facilitates Easy maintenance and modification of executing code. __||__ It supports automatic Garbage collections | It_can be easily integrated with C, C’*, Java etc. Python syntax comparison to other programming language: _« || Python has some similarities with English language with influence | from mathematics, Python uses new lines to complete and command. Other language Step 1 Step 1 — Run the Application Run the Application Bt Step2 Step 2 b Test the Application Test the Application Step 3 Step 3 Edit source code Again Edit source code Again step 4 Step 4 Recompile | Repeat (if needed) step 5 | RelinkEngineering Express @ | Python IDE: PyCharm- | Jupyter Notebook | Wing IDE | Sublime text Atom PyCharm: Interactive python console __© || Support for web framework Fast refracting time |Lesser development | Jupyter Notebook: ANN cof wid : In-built refracting capacity _|| Sublime text: Cross platform Multitasking | Better customizationEngineering Express @ Atom: | Better customization Better uses interfc : 5 To run a python program e vari described below: Run on IDLE (integrated Development Environment for Python):- To run python program_on IDLE, follow the given steps: Write the python code and save it. |To run the program, go to Rum>Run Module or simply click FS. _| |Run_on Command line: 7 | it fil nie \\\, . fl 5 Ai it fi ‘ he ”, -h f File wi | python script, bx: / f rh ” Ty . ; ne [Python hellopy) |Run on Text Editor: | Steps are as follows: = z Ai let “hello.py” 5 the file. To run the code, Right click > select Run code, Else press ‘ctrl talt +N’ to run the code Input/Output Function in python; © Output function: This function help to print or display the output after the executing line of code.Engineering Express @ We can give one or more arguments and prints them to the __| tandard output. | Syntax: print”) Ex: printCHello World”) | Output: Hello World output: hello world rintChello worl I hello world Input function: seer LA ov enter some Text and returns that text_as_a_string. a BY lecnbt CordnO Comments: | Single-line comments: Created with t. Used for short explanations on the same line. Syntax: BSS esi line. Chlock) : Used for longer explanations spanning multiple lines. |__ Syntax: Mult-line comment Python program >> Best practices (Advantage of comments): Provide clarity and context.Engineering Express @ program. For example: in = For example: number =10.S Syntax: variable=expression zocall ; ; AY oll asia toaol NE cei ) ; enn ; and else in return as except is True assert finally lambda try break false nonlocal with class for None while continue from not yield def global or del if pass “|| ent import raise Identifier:Engineering Express @ | Must start with letter Ca-z, A-2) or an underscore (_) Data types: Data types are the classification or categorization of data items, It represents the kindof value that tells what operations can be performed on a particular data Data Types in Python = 3 =o So be & | Integer Cint): Represents whole numbers without decimal points Example: y=S Complex(complex):Engineering Express @ | Represents complex numbers with a_re i Example: 2= 3+4) Float Coat): _|| Represents numbers with decimal_points over in exponential form. | Example: y=3.14 Dicti (dict): Represents a collection of key-val irs Example: person= fname’: ‘Alice’, ‘age’ 2S? Boolean(bool): Represents either true or false. TupleCtuple): Similar to_a_list but immutable (cannot be changed after creation) Example: coordination= (4,5) “"NoneTypeCNone);Engineering Express @ | Represents the absence of a value ora null value. | Type conversion: Type conversion in_python_is changing the datatype of a variable, a ion: Automatic conversion n_ based on the o, ion Being performed. Explicit_conversionCcasting): |IntQ_ for integer conversion. |Float©)_for float conversion. StrO_ for string conversion Loperation will be performed first. There the various type of expressions are as follows: Content expression Arithmetic expression Integer expression || Flight expression mS bw fe > Relational expressionEngineering Express @ | Logical expression _|| operations on operands. | Assignment operators Comparison operators Logical operators Identity operators __= ||Membership operators Bitwise_ operators + Ad 442 6 — : Subtraction 4-2 2 ~~ T —- * Muitiplication 4*2 8 —_ ——_r- 1 Division 412 2 — Modulus operator to get % remainder in integer division 5%2 1 [ ++ Increment A=10; i Att — — -—= Decrement A= 10; 9! A-- Applying addition between two numbers, a=l2 | b=10 c=a tbEngineering Express @ | printCc) | Output: 22 | Assignment operation Assignment operations are used to_assign the value to variable. Operator Equals To + E oe = a IF aes a=a>>10 <
2 True <= Less than or equal to 5<=2 False >= Greater than or equal to True = Equal to False l= Not equal to 5=! True It compared two value and retum true or false, Example: A=! B=2 print(a==b, a>b, b>a) output: false false true Logical operators: Perform logical operations on Boolean values. and Logical and (5<2) and (5>3) False or Logical or (5<2) or (5>3) True not Logical not not (5<2) True Identity operators: It compare the memory location of two objects.Engineering Express Operator Name Example is TRUE, if both the variable xisy points to the same object, with same memory locations. is not TRUE, if both the variable xisnoty points to different objects. | Example: |a=S |b=a |print(a is b, a is not b) |output: true false p | Membership operators: | Check_if the value is a_member_of a_sequence. Operator Name Example in TRUE, if variable is in the list, | xin y string, dictionary, etc. not in TRU, if variable isnot inthe | xnotiny list, string, dictionary, etc. Example: a=[),2,3,5] b=4 print(b in a, b not in a) output: false true Bitwise_operators:Engineering Express Perform operations on individual bits of binary numbers. Operator Meaning & Bitwise AND I Bitwise OR “ Bitwise exclusive OR / Bitwise XOR_ ~ Bitwise inversion (one’s complement) << Shifts the bits to left / Bitwise Left Shift >> Shifts the bits to right /Bitwise Right Shift Lxarnple: 4 TN a a=3 LZ La \ Se ah. b=? |print(a & b, ~a) Sa. = a loutput: 3 4 ___Python Operator Precedence ay Precedence ign | Operator Name Highest Exponentiation ‘Unary positive, unary negative, bitwise negation Multiplication, division, fo dlivision, modulus ie Addition, subtraction -shift,right-shift & Bitwise AND: x ‘Bitwise XOR 1 Bitwise OR = a is,isnot not Boolean NOT Comparlson, identity ay ‘a, i eee!Engineering Express @ Determine the order of execution for operators with the same | precedence. There are two type oi ociativity: L ight: first the move towards_right. |__2. Right to Left: Operators of the same precedence are executed from the right | Example |a=3+2-] | printCa) output: 4 Operators of the same precedence are executed from the left side ||Engineering Express: Simplifying Engineering Education ‘Are you drowning in complex engineering concepts? Struggling to decipher cryptic notes? Fear not! Welcome to Engineering Express, where we decode the mysteries of engineering subjects for you. §P What We Offer: Clear Explanotions: Our notes break down intricate topics into bite-sized, easy-to-understand language, No jargon, no headaches! Real-Life Connections: Ever wondered how those abstract formulas apply in the real world? We've got you covered with relatable examples. Maximize Your Marks: Our mission? Boost your exam scores. With our straightforward notes, you'll be well- prepared to conquer any engineering challenge. Follow us on social media YouTube - https://www youtube.com/@Engineering Express. ?sub_contirmation=I WhatsApp - https://chat.whatsapp.com/H]6tpUl2SmQ3o6vleD2Dlu Instagram - https://www.instagram.com/engineeringexpress2 312/ Telegram - https://t.me/engineeringexpressofficial Join the Engineering Express community today ond unlock the power of simplified learning! <7 @
You might also like
CST 445-Python For Engineers
PDF
No ratings yet
CST 445-Python For Engineers
54 pages
Python - 10 Marks Sol. of Previous PUT_Bharat_Agg
PDF
No ratings yet
Python - 10 Marks Sol. of Previous PUT_Bharat_Agg
43 pages
Basic Python
PDF
No ratings yet
Basic Python
101 pages
Python Introduction
PDF
No ratings yet
Python Introduction
111 pages
Lab 1 - Introduction To Python
PDF
No ratings yet
Lab 1 - Introduction To Python
12 pages
Python 1
PDF
No ratings yet
Python 1
11 pages
Python Training
PDF
No ratings yet
Python Training
43 pages
Python Tour 1 and 2 Notes
PDF
No ratings yet
Python Tour 1 and 2 Notes
24 pages
Python - Lecture 01 AM
PDF
No ratings yet
Python - Lecture 01 AM
36 pages
Python
PDF
No ratings yet
Python
73 pages
Python PPT 2
PDF
100% (1)
Python PPT 2
36 pages
CISA 4309: Scripting Languages By: Dr. Smriti Bhatt
PDF
No ratings yet
CISA 4309: Scripting Languages By: Dr. Smriti Bhatt
27 pages
QC Python
PDF
No ratings yet
QC Python
12 pages
lec_1_extended
PDF
No ratings yet
lec_1_extended
26 pages
Basics of Python - Part 1
PDF
No ratings yet
Basics of Python - Part 1
38 pages
Programming With Python
PDF
No ratings yet
Programming With Python
20 pages
Unit 2 Python
PDF
No ratings yet
Unit 2 Python
13 pages
Session One
PDF
No ratings yet
Session One
43 pages
Class Xi Python
PDF
100% (2)
Class Xi Python
138 pages
Python Keywords
PDF
No ratings yet
Python Keywords
20 pages
Unit-1
PDF
No ratings yet
Unit-1
14 pages
Introduction Python Operators
PDF
No ratings yet
Introduction Python Operators
59 pages
Manual of Python
PDF
No ratings yet
Manual of Python
43 pages
Python.notes
PDF
No ratings yet
Python.notes
13 pages
Practical # 1
PDF
No ratings yet
Practical # 1
50 pages
Module 1
PDF
No ratings yet
Module 1
42 pages
UNIT II BASICS OF PYTHON PROGRAMMING
PDF
No ratings yet
UNIT II BASICS OF PYTHON PROGRAMMING
102 pages
Python
PDF
No ratings yet
Python
88 pages
Python For Security - Chapter 1
PDF
No ratings yet
Python For Security - Chapter 1
75 pages
Python Introduction-1
PDF
No ratings yet
Python Introduction-1
56 pages
Unit 1 Basics of Python
PDF
No ratings yet
Unit 1 Basics of Python
43 pages
MODULE1
PDF
No ratings yet
MODULE1
71 pages
Record Experiment 6
PDF
No ratings yet
Record Experiment 6
69 pages
1 Revision of the basics of python_250206_202350
PDF
No ratings yet
1 Revision of the basics of python_250206_202350
61 pages
Ch1.pptx
PDF
No ratings yet
Ch1.pptx
31 pages
Lecture 3 - Introduction To Computer Data Processing Using Python
PDF
No ratings yet
Lecture 3 - Introduction To Computer Data Processing Using Python
22 pages
python (1)
PDF
No ratings yet
python (1)
139 pages
Python Basics
PDF
No ratings yet
Python Basics
54 pages
Lecture 01 Python I
PDF
No ratings yet
Lecture 01 Python I
31 pages
Basic of python class 11
PDF
No ratings yet
Basic of python class 11
5 pages
python ppt
PDF
No ratings yet
python ppt
102 pages
Python Notes
PDF
No ratings yet
Python Notes
23 pages
1 1pythonworld PDF
PDF
No ratings yet
1 1pythonworld PDF
85 pages
ACFrOgBXTcmr5nDjyAy9IXK9-GbKiZG1c076WJvpDXBm_JhwkwVTsEAjXYeIEATtq9-GMiujxhCcFwsJBTkbgBO94jHm_hLFd92NWCIs_kJKiAplXkqxX9ZY3oERLdWfENGq147Gzx6lcIdHiONu8ov9UGM_YqXE4ZPepaTslw==
PDF
No ratings yet
ACFrOgBXTcmr5nDjyAy9IXK9-GbKiZG1c076WJvpDXBm_JhwkwVTsEAjXYeIEATtq9-GMiujxhCcFwsJBTkbgBO94jHm_hLFd92NWCIs_kJKiAplXkqxX9ZY3oERLdWfENGq147Gzx6lcIdHiONu8ov9UGM_YqXE4ZPepaTslw==
10 pages
ELE492 - Lecture 2 - 28-02-2023
PDF
No ratings yet
ELE492 - Lecture 2 - 28-02-2023
99 pages
1664611760basics-of-python-1
PDF
No ratings yet
1664611760basics-of-python-1
74 pages
Day-1 AdvPython WS
PDF
No ratings yet
Day-1 AdvPython WS
36 pages
12 CS Chapter-1
PDF
No ratings yet
12 CS Chapter-1
13 pages
Numbers String List Tuple Dictionary
PDF
No ratings yet
Numbers String List Tuple Dictionary
5 pages
Python Lab
PDF
No ratings yet
Python Lab
108 pages
1 fundamental of python notes for school
PDF
No ratings yet
1 fundamental of python notes for school
12 pages
Python
PDF
No ratings yet
Python
38 pages
UNIT-II
PDF
No ratings yet
UNIT-II
23 pages
IPP Unit 1 Note
PDF
No ratings yet
IPP Unit 1 Note
7 pages
Python - Learn Data Analytics Together's Group
PDF
No ratings yet
Python - Learn Data Analytics Together's Group
71 pages
Python Unit II Notes
PDF
No ratings yet
Python Unit II Notes
31 pages
DATA, EXPRESSIONS, STATEMENTS
PDF
No ratings yet
DATA, EXPRESSIONS, STATEMENTS
37 pages
28.1.2 Lab - Construct a Basic Python Script (1)
PDF
No ratings yet
28.1.2 Lab - Construct a Basic Python Script (1)
15 pages
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
CST 445-Python For Engineers
PDF
CST 445-Python For Engineers
Python - 10 Marks Sol. of Previous PUT_Bharat_Agg
PDF
Python - 10 Marks Sol. of Previous PUT_Bharat_Agg
Basic Python
PDF
Basic Python
Python Introduction
PDF
Python Introduction
Lab 1 - Introduction To Python
PDF
Lab 1 - Introduction To Python
Python 1
PDF
Python 1
Python Training
PDF
Python Training
Python Tour 1 and 2 Notes
PDF
Python Tour 1 and 2 Notes
Python - Lecture 01 AM
PDF
Python - Lecture 01 AM
Python
PDF
Python
Python PPT 2
PDF
Python PPT 2
CISA 4309: Scripting Languages By: Dr. Smriti Bhatt
PDF
CISA 4309: Scripting Languages By: Dr. Smriti Bhatt
QC Python
PDF
QC Python
lec_1_extended
PDF
lec_1_extended
Basics of Python - Part 1
PDF
Basics of Python - Part 1
Programming With Python
PDF
Programming With Python
Unit 2 Python
PDF
Unit 2 Python
Session One
PDF
Session One
Class Xi Python
PDF
Class Xi Python
Python Keywords
PDF
Python Keywords
Unit-1
PDF
Unit-1
Introduction Python Operators
PDF
Introduction Python Operators
Manual of Python
PDF
Manual of Python
Python.notes
PDF
Python.notes
Practical # 1
PDF
Practical # 1
Module 1
PDF
Module 1
UNIT II BASICS OF PYTHON PROGRAMMING
PDF
UNIT II BASICS OF PYTHON PROGRAMMING
Python
PDF
Python
Python For Security - Chapter 1
PDF
Python For Security - Chapter 1
Python Introduction-1
PDF
Python Introduction-1
Unit 1 Basics of Python
PDF
Unit 1 Basics of Python
MODULE1
PDF
MODULE1
Record Experiment 6
PDF
Record Experiment 6
1 Revision of the basics of python_250206_202350
PDF
1 Revision of the basics of python_250206_202350
Ch1.pptx
PDF
Ch1.pptx
Lecture 3 - Introduction To Computer Data Processing Using Python
PDF
Lecture 3 - Introduction To Computer Data Processing Using Python
python (1)
PDF
python (1)
Python Basics
PDF
Python Basics
Lecture 01 Python I
PDF
Lecture 01 Python I
Basic of python class 11
PDF
Basic of python class 11
python ppt
PDF
python ppt
Python Notes
PDF
Python Notes
1 1pythonworld PDF
PDF
1 1pythonworld PDF
ACFrOgBXTcmr5nDjyAy9IXK9-GbKiZG1c076WJvpDXBm_JhwkwVTsEAjXYeIEATtq9-GMiujxhCcFwsJBTkbgBO94jHm_hLFd92NWCIs_kJKiAplXkqxX9ZY3oERLdWfENGq147Gzx6lcIdHiONu8ov9UGM_YqXE4ZPepaTslw==
PDF
ACFrOgBXTcmr5nDjyAy9IXK9-GbKiZG1c076WJvpDXBm_JhwkwVTsEAjXYeIEATtq9-GMiujxhCcFwsJBTkbgBO94jHm_hLFd92NWCIs_kJKiAplXkqxX9ZY3oERLdWfENGq147Gzx6lcIdHiONu8ov9UGM_YqXE4ZPepaTslw==
ELE492 - Lecture 2 - 28-02-2023
PDF
ELE492 - Lecture 2 - 28-02-2023
1664611760basics-of-python-1
PDF
1664611760basics-of-python-1
Day-1 AdvPython WS
PDF
Day-1 AdvPython WS
12 CS Chapter-1
PDF
12 CS Chapter-1
Numbers String List Tuple Dictionary
PDF
Numbers String List Tuple Dictionary
Python Lab
PDF
Python Lab
1 fundamental of python notes for school
PDF
1 fundamental of python notes for school
Python
PDF
Python
UNIT-II
PDF
UNIT-II
IPP Unit 1 Note
PDF
IPP Unit 1 Note
Python - Learn Data Analytics Together's Group
PDF
Python - Learn Data Analytics Together's Group
Python Unit II Notes
PDF
Python Unit II Notes
DATA, EXPRESSIONS, STATEMENTS
PDF
DATA, EXPRESSIONS, STATEMENTS
28.1.2 Lab - Construct a Basic Python Script (1)
PDF
28.1.2 Lab - Construct a Basic Python Script (1)