SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
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
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Último (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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
 
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
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"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...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

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