SlideShare a Scribd company logo
1 of 17
Download to read offline
Instructor: Ebad ullah Qureshi
Email: ebadullah.qureshi@rutgers.edu
N2E Coding Club
Python Workshop
Welcome to
Python 101!
Python workshop by Ebad ullah Qureshi
About this Workshop
Meetings
• Thursdays on 8:00 PM to 9:00 PM @ CORE 538
Workshop Goals
• Learn fundamentals of Programming in Python
• Apply those fundamentals to Solve Problems
Source Code will be shared on my Github https://github.com/Ebad8931
IEEE N2E Coding Club Facebook Group https://www.facebook.com/groups/RutgersIEEE.N2E/
2
Python workshop by Ebad ullah Qureshi
Preliminaries
3
Things You need
• Laptop/PC
• Python – Download latest version https://www.python.org/downloads/
• Pycharm IDE – Download free edition at https://www.jetbrains.com/pycharm/
Recommended Resources
• Python Official Documentation – https://www.python.org/doc/
• Sololearn App – Python modules
• Hackerrank or Leetcode – Coding Exercises
• [Book] 101 Python Challenges with Solutions/Code Listings by Philippe Kerampran
Python workshop by Ebad ullah Qureshi
The Incredible Growth of Python!
Python has been growing rapidly in the
last few years based on data from Stack
overflow.
More information on this trend along
with future projections is available in
David Robinson’s blog published on
09/06/2017.
Link to blog:
https://stackoverflow.blog/2017/09/06/i
ncredible-growth-python/
4
Python workshop by Ebad ullah Qureshi
Pros and Cons of Python
• Easy to Use and Fast to Develop
• Open Source
• Abundant libraries – from web
development through game development
to machine learning
• Great for Prototypes – Ability to achieve
more with less lines of code
• Speed limitations
• Problems with threading
• Not native to mobile development
Python is not a perfect fit for all projects but it can be a very good choice in many use cases.
This language is an obvious choice for machine learning, data analysis and visualization.
Read full article: https://www.netguru.com/blog/python-pros-and-cons-what-are-the-benefits-and-downsides-of-the-
programming-language
5
Python workshop by Ebad ullah Qureshi
Getting Started: First Python Program
print('Hello World')
Hello World
Alternatively;
Our First Python Program prints out “Hello World”.
print(“Hello World”)
Hello World
6
Python workshop by Ebad ullah Qureshi
Exercise: Display
7
Display the following:
• He asked, “how are you?”
• The Professor didn’t curve the final exam.
• Your first and Last Name on separate lines
• H:My DriveSpring 2019n2e_python_workshop
print('He asked,"how are you?"')
print('The Professor didn‟t curve the final exam.')
print("[FirstName]n[LastName]")
print(r"H:My DriveSpring 2019n2e_python_workshop")
Python workshop by Ebad ullah Qureshi
Basic Arithmetic Operators – I
print(3+4.2) # Addition
7.2
print(56-34) # Subtraction
22
print(6*7.5) # Multiplication
45.0
print(8**2) # Exponent
64
8
Python workshop by Ebad ullah Qureshi
Basic Arithmetic Operators – II
print(32/8) # Division
4.0
print(37//8) # Floor Division
4
print(37 % 8) # Remainder
5
9
Python workshop by Ebad ullah Qureshi
Floats
• Floats are representation of fractional numbers in a computer memory
• Numbers like 0.67, 3.6, 25.4445, 9.0 are floats
• Notice in the previous section;
 Division of 2 integers results in a float
 Operation on an integer and a float results in a float
10
Python workshop by Ebad ullah Qureshi
Strings
# String Addition
print('IEEE ' + 'N2E ' + 'Python Workshop„)
# String Multiplication
print('python ' * 5)
• Data type for storing text
• Generally created by enclosing text in single quotes
• Python allows
 addition of strings
 multiplication of a string with an integer
IEEE N2E Python Workshop
python python python python python
11
Python workshop by Ebad ullah Qureshi
Variables – I
• Variables are reserved memory locations to store values
• Python variables do not need explicit declaration to reserve memory space.
• The declaration occurs when the variable is assigned a value using the assignment operator(=)
• Python allows you to assign a single value to several variables simultaneously. This value will
be stored at a single memory location. For example:
• Python also allows multiple variables to be assigned at once. For Example
var = 'python‟ # the value python is assigned to the variable var
a = b = c = 100
course, building, Room = “Python”, “Core”, 538
12
Python workshop by Ebad ullah Qureshi
Variables – II
• Variables can be reassigned as many times as you want.
• In Python, variables do not have a Specific type and therefore be assigned a string and then
later an integer.
• Variable names do not start with numbers. By convention, all variable names are lower case
with ‘_’ between letters.
• Trying to reference a variable with no value assigned causes an error.
13
Python workshop by Ebad ullah Qureshi
Assignment Operators
var_x = 8
var_y = 6
var_y += 4 # y=y+4
var_x /= 2 # x=x/2
print(var_x)
print(var_y)
4.0
10
Assignment operators are used to assign values to variables.
14
Python workshop by Ebad ullah Qureshi
Comparison Operators
print(100 == 100)
print(110 > 110)
print(134 >= 134)
print(143 < 293)
print(456 <= 345 or "N2E" != "IEEE")
True
False
True
True
True
Comparison Operators compare two values and output a logical True or False
15
Python workshop by Ebad ullah Qureshi
Logical Operators
print(True and False) # Logical AND
print(True or False) # Logical OR
print(not False) # Logical
False
True
True
Logical Operators operate on Boolean values of True and False.
16
Instructor: Ebad ullah Qureshi
Email: ebadullah.qureshi@rutgers.edu
N2E Coding Club
Python Workshop
Python Introduction
Complete

More Related Content

What's hot

Pytest - testing tips and useful plugins
Pytest - testing tips and useful pluginsPytest - testing tips and useful plugins
Pytest - testing tips and useful pluginsAndreu Vallbona Plazas
 
Intro To Spring Python
Intro To Spring PythonIntro To Spring Python
Intro To Spring Pythongturnquist
 
Python and Machine Learning
Python and Machine LearningPython and Machine Learning
Python and Machine Learningtrygub
 
Python functions
Python functionsPython functions
Python functionsAliyamanasa
 
Python week 5 2019 2020 for g10 by eng.osama ghandour
Python week 5 2019 2020 for g10 by eng.osama ghandourPython week 5 2019 2020 for g10 by eng.osama ghandour
Python week 5 2019 2020 for g10 by eng.osama ghandourOsama Ghandour Geris
 
15 2. arguement passing to main
15 2. arguement passing to main15 2. arguement passing to main
15 2. arguement passing to main웅식 전
 
PyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimePyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimeNational Cheng Kung University
 
The Ring programming language version 1.8 book - Part 45 of 202
The Ring programming language version 1.8 book - Part 45 of 202The Ring programming language version 1.8 book - Part 45 of 202
The Ring programming language version 1.8 book - Part 45 of 202Mahmoud Samir Fayed
 
Introduction to Python for Bioinformatics
Introduction to Python for BioinformaticsIntroduction to Python for Bioinformatics
Introduction to Python for BioinformaticsJosé Héctor Gálvez
 
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Edureka!
 
Command line arguments that make you smile
Command line arguments that make you smileCommand line arguments that make you smile
Command line arguments that make you smileMartin Melin
 
Python03 course in_mumbai
Python03 course in_mumbaiPython03 course in_mumbai
Python03 course in_mumbaivibrantuser
 

What's hot (20)

Pytest - testing tips and useful plugins
Pytest - testing tips and useful pluginsPytest - testing tips and useful plugins
Pytest - testing tips and useful plugins
 
Python modules
Python modulesPython modules
Python modules
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Intro To Spring Python
Intro To Spring PythonIntro To Spring Python
Intro To Spring Python
 
Python Programming Essentials - M8 - String Methods
Python Programming Essentials - M8 - String MethodsPython Programming Essentials - M8 - String Methods
Python Programming Essentials - M8 - String Methods
 
Python and Machine Learning
Python and Machine LearningPython and Machine Learning
Python and Machine Learning
 
Python functions
Python functionsPython functions
Python functions
 
Python week 5 2019 2020 for g10 by eng.osama ghandour
Python week 5 2019 2020 for g10 by eng.osama ghandourPython week 5 2019 2020 for g10 by eng.osama ghandour
Python week 5 2019 2020 for g10 by eng.osama ghandour
 
15 2. arguement passing to main
15 2. arguement passing to main15 2. arguement passing to main
15 2. arguement passing to main
 
Python Basics
Python BasicsPython Basics
Python Basics
 
PyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimePyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtime
 
The Ring programming language version 1.8 book - Part 45 of 202
The Ring programming language version 1.8 book - Part 45 of 202The Ring programming language version 1.8 book - Part 45 of 202
The Ring programming language version 1.8 book - Part 45 of 202
 
Introduction to Python for Bioinformatics
Introduction to Python for BioinformaticsIntroduction to Python for Bioinformatics
Introduction to Python for Bioinformatics
 
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
 
fg.workshop: Software vulnerability
fg.workshop: Software vulnerabilityfg.workshop: Software vulnerability
fg.workshop: Software vulnerability
 
Command line arguments that make you smile
Command line arguments that make you smileCommand line arguments that make you smile
Command line arguments that make you smile
 
Python03 course in_mumbai
Python03 course in_mumbaiPython03 course in_mumbai
Python03 course in_mumbai
 
Python libraries
Python librariesPython libraries
Python libraries
 
Howto argparse
Howto argparseHowto argparse
Howto argparse
 
Python basics
Python basicsPython basics
Python basics
 

Similar to 01 Introduction to Python

04 Functional Programming in Python
04 Functional Programming in Python04 Functional Programming in Python
04 Functional Programming in PythonEbad ullah Qureshi
 
Intro to Python for Non-Programmers
Intro to Python for Non-ProgrammersIntro to Python for Non-Programmers
Intro to Python for Non-ProgrammersAhmad Alhour
 
02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions02 Control Structures - Loops & Conditions
02 Control Structures - Loops & ConditionsEbad ullah Qureshi
 
Python week 2 2019 2020 for g10 by eng.osama ghandour
Python week 2 2019 2020 for g10 by eng.osama ghandourPython week 2 2019 2020 for g10 by eng.osama ghandour
Python week 2 2019 2020 for g10 by eng.osama ghandourOsama Ghandour Geris
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughgabriellekuruvilla
 
02-Basic-Java-Syntax.pdf
02-Basic-Java-Syntax.pdf02-Basic-Java-Syntax.pdf
02-Basic-Java-Syntax.pdferusmala888
 
How to start learning java
How to start learning javaHow to start learning java
How to start learning javabillgatewilliam
 
علم البيانات - Data Sience
علم البيانات - Data Sience علم البيانات - Data Sience
علم البيانات - Data Sience App Ttrainers .com
 
PuppetConf 2016: Enjoying the Journey from Puppet 3.x to 4.x – Rob Nelson, AT&T
PuppetConf 2016: Enjoying the Journey from Puppet 3.x to 4.x – Rob Nelson, AT&T PuppetConf 2016: Enjoying the Journey from Puppet 3.x to 4.x – Rob Nelson, AT&T
PuppetConf 2016: Enjoying the Journey from Puppet 3.x to 4.x – Rob Nelson, AT&T Puppet
 
Leveling Up With Unit Testing - php[tek] 2023
Leveling Up With Unit Testing - php[tek] 2023Leveling Up With Unit Testing - php[tek] 2023
Leveling Up With Unit Testing - php[tek] 2023Mark Niebergall
 
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)Robert Nelson
 
Leveling Up With Unit Testing - LonghornPHP 2022
Leveling Up With Unit Testing - LonghornPHP 2022Leveling Up With Unit Testing - LonghornPHP 2022
Leveling Up With Unit Testing - LonghornPHP 2022Mark Niebergall
 
Format of first slide for main PPT-GIT.pptx
Format of first slide for main PPT-GIT.pptxFormat of first slide for main PPT-GIT.pptx
Format of first slide for main PPT-GIT.pptxMOHAMMADANISH12
 

Similar to 01 Introduction to Python (20)

04 Functional Programming in Python
04 Functional Programming in Python04 Functional Programming in Python
04 Functional Programming in Python
 
Intro to Python for Non-Programmers
Intro to Python for Non-ProgrammersIntro to Python for Non-Programmers
Intro to Python for Non-Programmers
 
05 python.pdf
05 python.pdf05 python.pdf
05 python.pdf
 
02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions
 
Python week 2 2019 2020 for g10 by eng.osama ghandour
Python week 2 2019 2020 for g10 by eng.osama ghandourPython week 2 2019 2020 for g10 by eng.osama ghandour
Python week 2 2019 2020 for g10 by eng.osama ghandour
 
Python basics
Python basicsPython basics
Python basics
 
Python week 1 2020-2021
Python week 1 2020-2021Python week 1 2020-2021
Python week 1 2020-2021
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
 
02-Basic-Java-Syntax.pdf
02-Basic-Java-Syntax.pdf02-Basic-Java-Syntax.pdf
02-Basic-Java-Syntax.pdf
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
How to start learning java
How to start learning javaHow to start learning java
How to start learning java
 
علم البيانات - Data Sience
علم البيانات - Data Sience علم البيانات - Data Sience
علم البيانات - Data Sience
 
PuppetConf 2016: Enjoying the Journey from Puppet 3.x to 4.x – Rob Nelson, AT&T
PuppetConf 2016: Enjoying the Journey from Puppet 3.x to 4.x – Rob Nelson, AT&T PuppetConf 2016: Enjoying the Journey from Puppet 3.x to 4.x – Rob Nelson, AT&T
PuppetConf 2016: Enjoying the Journey from Puppet 3.x to 4.x – Rob Nelson, AT&T
 
python program
python programpython program
python program
 
Leveling Up With Unit Testing - php[tek] 2023
Leveling Up With Unit Testing - php[tek] 2023Leveling Up With Unit Testing - php[tek] 2023
Leveling Up With Unit Testing - php[tek] 2023
 
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
 
Leveling Up With Unit Testing - LonghornPHP 2022
Leveling Up With Unit Testing - LonghornPHP 2022Leveling Up With Unit Testing - LonghornPHP 2022
Leveling Up With Unit Testing - LonghornPHP 2022
 
Anish PPT-GIT.pptx
Anish PPT-GIT.pptxAnish PPT-GIT.pptx
Anish PPT-GIT.pptx
 
Format of first slide for main PPT-GIT.pptx
Format of first slide for main PPT-GIT.pptxFormat of first slide for main PPT-GIT.pptx
Format of first slide for main PPT-GIT.pptx
 
PPT-GIT.pptx
PPT-GIT.pptxPPT-GIT.pptx
PPT-GIT.pptx
 

Recently uploaded

Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

01 Introduction to Python

  • 1. Instructor: Ebad ullah Qureshi Email: ebadullah.qureshi@rutgers.edu N2E Coding Club Python Workshop Welcome to Python 101!
  • 2. Python workshop by Ebad ullah Qureshi About this Workshop Meetings • Thursdays on 8:00 PM to 9:00 PM @ CORE 538 Workshop Goals • Learn fundamentals of Programming in Python • Apply those fundamentals to Solve Problems Source Code will be shared on my Github https://github.com/Ebad8931 IEEE N2E Coding Club Facebook Group https://www.facebook.com/groups/RutgersIEEE.N2E/ 2
  • 3. Python workshop by Ebad ullah Qureshi Preliminaries 3 Things You need • Laptop/PC • Python – Download latest version https://www.python.org/downloads/ • Pycharm IDE – Download free edition at https://www.jetbrains.com/pycharm/ Recommended Resources • Python Official Documentation – https://www.python.org/doc/ • Sololearn App – Python modules • Hackerrank or Leetcode – Coding Exercises • [Book] 101 Python Challenges with Solutions/Code Listings by Philippe Kerampran
  • 4. Python workshop by Ebad ullah Qureshi The Incredible Growth of Python! Python has been growing rapidly in the last few years based on data from Stack overflow. More information on this trend along with future projections is available in David Robinson’s blog published on 09/06/2017. Link to blog: https://stackoverflow.blog/2017/09/06/i ncredible-growth-python/ 4
  • 5. Python workshop by Ebad ullah Qureshi Pros and Cons of Python • Easy to Use and Fast to Develop • Open Source • Abundant libraries – from web development through game development to machine learning • Great for Prototypes – Ability to achieve more with less lines of code • Speed limitations • Problems with threading • Not native to mobile development Python is not a perfect fit for all projects but it can be a very good choice in many use cases. This language is an obvious choice for machine learning, data analysis and visualization. Read full article: https://www.netguru.com/blog/python-pros-and-cons-what-are-the-benefits-and-downsides-of-the- programming-language 5
  • 6. Python workshop by Ebad ullah Qureshi Getting Started: First Python Program print('Hello World') Hello World Alternatively; Our First Python Program prints out “Hello World”. print(“Hello World”) Hello World 6
  • 7. Python workshop by Ebad ullah Qureshi Exercise: Display 7 Display the following: • He asked, “how are you?” • The Professor didn’t curve the final exam. • Your first and Last Name on separate lines • H:My DriveSpring 2019n2e_python_workshop print('He asked,"how are you?"') print('The Professor didn‟t curve the final exam.') print("[FirstName]n[LastName]") print(r"H:My DriveSpring 2019n2e_python_workshop")
  • 8. Python workshop by Ebad ullah Qureshi Basic Arithmetic Operators – I print(3+4.2) # Addition 7.2 print(56-34) # Subtraction 22 print(6*7.5) # Multiplication 45.0 print(8**2) # Exponent 64 8
  • 9. Python workshop by Ebad ullah Qureshi Basic Arithmetic Operators – II print(32/8) # Division 4.0 print(37//8) # Floor Division 4 print(37 % 8) # Remainder 5 9
  • 10. Python workshop by Ebad ullah Qureshi Floats • Floats are representation of fractional numbers in a computer memory • Numbers like 0.67, 3.6, 25.4445, 9.0 are floats • Notice in the previous section;  Division of 2 integers results in a float  Operation on an integer and a float results in a float 10
  • 11. Python workshop by Ebad ullah Qureshi Strings # String Addition print('IEEE ' + 'N2E ' + 'Python Workshop„) # String Multiplication print('python ' * 5) • Data type for storing text • Generally created by enclosing text in single quotes • Python allows  addition of strings  multiplication of a string with an integer IEEE N2E Python Workshop python python python python python 11
  • 12. Python workshop by Ebad ullah Qureshi Variables – I • Variables are reserved memory locations to store values • Python variables do not need explicit declaration to reserve memory space. • The declaration occurs when the variable is assigned a value using the assignment operator(=) • Python allows you to assign a single value to several variables simultaneously. This value will be stored at a single memory location. For example: • Python also allows multiple variables to be assigned at once. For Example var = 'python‟ # the value python is assigned to the variable var a = b = c = 100 course, building, Room = “Python”, “Core”, 538 12
  • 13. Python workshop by Ebad ullah Qureshi Variables – II • Variables can be reassigned as many times as you want. • In Python, variables do not have a Specific type and therefore be assigned a string and then later an integer. • Variable names do not start with numbers. By convention, all variable names are lower case with ‘_’ between letters. • Trying to reference a variable with no value assigned causes an error. 13
  • 14. Python workshop by Ebad ullah Qureshi Assignment Operators var_x = 8 var_y = 6 var_y += 4 # y=y+4 var_x /= 2 # x=x/2 print(var_x) print(var_y) 4.0 10 Assignment operators are used to assign values to variables. 14
  • 15. Python workshop by Ebad ullah Qureshi Comparison Operators print(100 == 100) print(110 > 110) print(134 >= 134) print(143 < 293) print(456 <= 345 or "N2E" != "IEEE") True False True True True Comparison Operators compare two values and output a logical True or False 15
  • 16. Python workshop by Ebad ullah Qureshi Logical Operators print(True and False) # Logical AND print(True or False) # Logical OR print(not False) # Logical False True True Logical Operators operate on Boolean values of True and False. 16
  • 17. Instructor: Ebad ullah Qureshi Email: ebadullah.qureshi@rutgers.edu N2E Coding Club Python Workshop Python Introduction Complete