SlideShare a Scribd company logo
Basic use of Python
-Practice-
National Institute of Technology, Anan College, JAPAN
Yoshiki Satotani
1. Basic operations
Basic data types
• Create following lists with range function.
1. [0, 1, 2, 3, 4]
2. [3, 4, 5, 6, 7]
3. [3, 6, 9, 12, 15, 18]
4. [2, 4, 6, 8, 12, 16, 20] hint: use + operator
Basic data types
• Create a dictionary that
1. Keys are [0, 1, …, 10]
2. Values are (key) * 2
i.e. d[0]=0, d[1]=2, d[2]=4, …, d[10]=20
Hint: use zip() function
2. Control flow statements
Control flow statements practice
• For integer variable named ‘x’,
• Print ‘fizz’ if x can be divided by 3
• Print ‘buzz’ if x can be divided by 5
(e.g. if x is 10, print ‘buzz’, x is 15, print ‘fizz buzz’)
(hint: use % operator(e.g. 10 % 3 = 1, 14 % 5 = 4))
Control flow statements practice
• Create a list only contains
• Multiple of 3 or 5 (3, 5, 6, 9…)
• Between 1 and 20
i.e. [3, 5, 6, 9, 10, 12, 15, 18, 20]
Control flow statements practice
• Find the 10-th Fibonacci sequence
• Fibonacci sequence is
• 0, 1, 1, 2, 3, 5, 8, …
• The next number is found by adding up the two numbers before it(e.g.
5th number 3 = 2 + 1).
• Hint: You need to use recursive function
3. Graph with matplotlib
Graph practice
• Draw the graph of
binary entropy function
𝐻 𝑝 = −𝑝log2 𝑝 − 1 − 𝑝 log2 1 − 𝑝
• Hint: use np.log2 to
calculate log2

More Related Content

What's hot

FSB: TreeWalker - SECCON 2015 Online CTF
FSB: TreeWalker - SECCON 2015 Online CTFFSB: TreeWalker - SECCON 2015 Online CTF
FSB: TreeWalker - SECCON 2015 Online CTF
YOKARO-MON
 
1 arrays and sorting
1 arrays and sorting1 arrays and sorting
1 arrays and sortingnotshoaib
 
OREO - Hack.lu CTF 2014
OREO - Hack.lu CTF 2014OREO - Hack.lu CTF 2014
OREO - Hack.lu CTF 2014
YOKARO-MON
 
Python : Data Types
Python : Data TypesPython : Data Types
Python for Beginners(v3)
Python for Beginners(v3)Python for Beginners(v3)
Python for Beginners(v3)
Panimalar Engineering College
 
Mcq cpup
Mcq cpupMcq cpup
Mcq cpup
tahir_ali786
 
Hands on Session on Python
Hands on Session on PythonHands on Session on Python
Hands on Session on Python
Sumit Raj
 
Python Basics #1
Python Basics #1Python Basics #1
Python Basics #1
Roland Askew
 
Collection Core Concept
Collection Core ConceptCollection Core Concept
Collection Core Concept
Rays Technologies
 
Slink into Elixir
Slink into ElixirSlink into Elixir
Slink into Elixir
LINE Corporation
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
Rakotoarison Louis Frederick
 
Python - Lecture 6
Python - Lecture 6Python - Lecture 6
Python - Lecture 6
Ravi Kiran Khareedi
 
More About Strings
More About StringsMore About Strings
More About Strings
Munazza-Mah-Jabeen
 
The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84
Mahmoud Samir Fayed
 
Iteration
IterationIteration
Iteration
Pooja B S
 
جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۱
جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۱جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۱
جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۱
Mohammad Reza Kamalifard
 
Class 2: Welcome part 2
Class 2: Welcome part 2Class 2: Welcome part 2
Class 2: Welcome part 2
Marc Gouw
 

What's hot (20)

Talk Code
Talk CodeTalk Code
Talk Code
 
FSB: TreeWalker - SECCON 2015 Online CTF
FSB: TreeWalker - SECCON 2015 Online CTFFSB: TreeWalker - SECCON 2015 Online CTF
FSB: TreeWalker - SECCON 2015 Online CTF
 
1 arrays and sorting
1 arrays and sorting1 arrays and sorting
1 arrays and sorting
 
OREO - Hack.lu CTF 2014
OREO - Hack.lu CTF 2014OREO - Hack.lu CTF 2014
OREO - Hack.lu CTF 2014
 
Python : Data Types
Python : Data TypesPython : Data Types
Python : Data Types
 
Beginning Python
Beginning PythonBeginning Python
Beginning Python
 
Python for Beginners(v3)
Python for Beginners(v3)Python for Beginners(v3)
Python for Beginners(v3)
 
Mcq cpup
Mcq cpupMcq cpup
Mcq cpup
 
Hands on Session on Python
Hands on Session on PythonHands on Session on Python
Hands on Session on Python
 
Python Basics #1
Python Basics #1Python Basics #1
Python Basics #1
 
Collection Core Concept
Collection Core ConceptCollection Core Concept
Collection Core Concept
 
Slink into Elixir
Slink into ElixirSlink into Elixir
Slink into Elixir
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Python - Lecture 6
Python - Lecture 6Python - Lecture 6
Python - Lecture 6
 
Java Unit 1 Project
Java Unit 1 ProjectJava Unit 1 Project
Java Unit 1 Project
 
More About Strings
More About StringsMore About Strings
More About Strings
 
The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84
 
Iteration
IterationIteration
Iteration
 
جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۱
جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۱جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۱
جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۱
 
Class 2: Welcome part 2
Class 2: Welcome part 2Class 2: Welcome part 2
Class 2: Welcome part 2
 

Viewers also liked

Global marketing
Global marketingGlobal marketing
Global marketing
Ronald M. Herber
 
Stewart Kane CV 2016
Stewart Kane CV 2016Stewart Kane CV 2016
Stewart Kane CV 2016Stewart Kane
 
Catálogo de-productos-fashion-woman-s.a
Catálogo de-productos-fashion-woman-s.aCatálogo de-productos-fashion-woman-s.a
Catálogo de-productos-fashion-woman-s.a
Jezee Llanque
 
Vpmsc Client Introduction Package (1)
Vpmsc Client Introduction Package (1)Vpmsc Client Introduction Package (1)
Vpmsc Client Introduction Package (1)Cory Gilmore
 
รักษาโรคมะเร็ง
รักษาโรคมะเร็งรักษาโรคมะเร็ง
รักษาโรคมะเร็ง
pornkanok02
 
NetIQ Advanced Authentication
NetIQ Advanced AuthenticationNetIQ Advanced Authentication
NetIQ Advanced Authentication
Finceptum Oy
 
Akshat Mathur- Architect
Akshat Mathur- ArchitectAkshat Mathur- Architect
Akshat Mathur- Architectakshat mathur
 
W.Melis_Sample1_CONF_Logo-Signage-Booth. Concept to final
W.Melis_Sample1_CONF_Logo-Signage-Booth. Concept to finalW.Melis_Sample1_CONF_Logo-Signage-Booth. Concept to final
W.Melis_Sample1_CONF_Logo-Signage-Booth. Concept to finalWendy Melis
 
GRaMmEr MistaKEs 常见语法错误
GRaMmEr MistaKEs 常见语法错误GRaMmEr MistaKEs 常见语法错误
GRaMmEr MistaKEs 常见语法错误路人 路过
 

Viewers also liked (12)

Global marketing
Global marketingGlobal marketing
Global marketing
 
Stewart Kane CV 2016
Stewart Kane CV 2016Stewart Kane CV 2016
Stewart Kane CV 2016
 
C.V.
C.V.C.V.
C.V.
 
Catálogo de-productos-fashion-woman-s.a
Catálogo de-productos-fashion-woman-s.aCatálogo de-productos-fashion-woman-s.a
Catálogo de-productos-fashion-woman-s.a
 
አሰስዳ
አሰስዳአሰስዳ
አሰስዳ
 
Vpmsc Client Introduction Package (1)
Vpmsc Client Introduction Package (1)Vpmsc Client Introduction Package (1)
Vpmsc Client Introduction Package (1)
 
รักษาโรคมะเร็ง
รักษาโรคมะเร็งรักษาโรคมะเร็ง
รักษาโรคมะเร็ง
 
NetIQ Advanced Authentication
NetIQ Advanced AuthenticationNetIQ Advanced Authentication
NetIQ Advanced Authentication
 
Akshat Mathur- Architect
Akshat Mathur- ArchitectAkshat Mathur- Architect
Akshat Mathur- Architect
 
Pelajaran6
Pelajaran6Pelajaran6
Pelajaran6
 
W.Melis_Sample1_CONF_Logo-Signage-Booth. Concept to final
W.Melis_Sample1_CONF_Logo-Signage-Booth. Concept to finalW.Melis_Sample1_CONF_Logo-Signage-Booth. Concept to final
W.Melis_Sample1_CONF_Logo-Signage-Booth. Concept to final
 
GRaMmEr MistaKEs 常见语法错误
GRaMmEr MistaKEs 常见语法错误GRaMmEr MistaKEs 常见语法错误
GRaMmEr MistaKEs 常见语法错误
 

Similar to Basic use of Python (Practice)

Python: The Dynamic!
Python: The Dynamic!Python: The Dynamic!
Python: The Dynamic!
Omid Mogharian
 
Introduction to Python3 Programming Language
Introduction to Python3 Programming LanguageIntroduction to Python3 Programming Language
Introduction to Python3 Programming Language
Tushar Mittal
 
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
DRVaibhavmeshram1
 
arrays
arraysarrays
arrays
teach4uin
 
PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop - Xi...
PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop  - Xi...PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop  - Xi...
PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop - Xi...
The Statistical and Applied Mathematical Sciences Institute
 
01-Python-Basics.ppt
01-Python-Basics.ppt01-Python-Basics.ppt
01-Python-Basics.ppt
VicVic56
 
Array i imp
Array  i impArray  i imp
Array i imp
Vivek Kumar
 
Python slide
Python slidePython slide
Arrays 06.ppt
Arrays 06.pptArrays 06.ppt
Arrays 06.ppt
ahtishamtariq511
 
Operating system labs
Operating system labsOperating system labs
Operating system labs
bhaktisagar4
 
Python Tutorial
Python TutorialPython Tutorial
Python Tutorial
Eueung Mulyana
 
Numpy Talk at SIAM
Numpy Talk at SIAMNumpy Talk at SIAM
Numpy Talk at SIAM
Enthought, Inc.
 
Introduction To Programming with Python
Introduction To Programming with PythonIntroduction To Programming with Python
Introduction To Programming with Python
Sushant Mane
 
Migrating from matlab to python
Migrating from matlab to pythonMigrating from matlab to python
Migrating from matlab to pythonActiveState
 
Advance data structure & algorithm
Advance data structure & algorithmAdvance data structure & algorithm
Advance data structure & algorithm
K Hari Shankar
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
Daniel Greenfeld
 
Effective Numerical Computation in NumPy and SciPy
Effective Numerical Computation in NumPy and SciPyEffective Numerical Computation in NumPy and SciPy
Effective Numerical Computation in NumPy and SciPy
Kimikazu Kato
 
Python.pptx
Python.pptxPython.pptx
python lab programs.pdf
python lab programs.pdfpython lab programs.pdf
python lab programs.pdf
CBJWorld
 
Learn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesLearn 90% of Python in 90 Minutes
Learn 90% of Python in 90 Minutes
Matt Harrison
 

Similar to Basic use of Python (Practice) (20)

Python: The Dynamic!
Python: The Dynamic!Python: The Dynamic!
Python: The Dynamic!
 
Introduction to Python3 Programming Language
Introduction to Python3 Programming LanguageIntroduction to Python3 Programming Language
Introduction to Python3 Programming Language
 
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
 
arrays
arraysarrays
arrays
 
PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop - Xi...
PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop  - Xi...PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop  - Xi...
PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop - Xi...
 
01-Python-Basics.ppt
01-Python-Basics.ppt01-Python-Basics.ppt
01-Python-Basics.ppt
 
Array i imp
Array  i impArray  i imp
Array i imp
 
Python slide
Python slidePython slide
Python slide
 
Arrays 06.ppt
Arrays 06.pptArrays 06.ppt
Arrays 06.ppt
 
Operating system labs
Operating system labsOperating system labs
Operating system labs
 
Python Tutorial
Python TutorialPython Tutorial
Python Tutorial
 
Numpy Talk at SIAM
Numpy Talk at SIAMNumpy Talk at SIAM
Numpy Talk at SIAM
 
Introduction To Programming with Python
Introduction To Programming with PythonIntroduction To Programming with Python
Introduction To Programming with Python
 
Migrating from matlab to python
Migrating from matlab to pythonMigrating from matlab to python
Migrating from matlab to python
 
Advance data structure & algorithm
Advance data structure & algorithmAdvance data structure & algorithm
Advance data structure & algorithm
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Effective Numerical Computation in NumPy and SciPy
Effective Numerical Computation in NumPy and SciPyEffective Numerical Computation in NumPy and SciPy
Effective Numerical Computation in NumPy and SciPy
 
Python.pptx
Python.pptxPython.pptx
Python.pptx
 
python lab programs.pdf
python lab programs.pdfpython lab programs.pdf
python lab programs.pdf
 
Learn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesLearn 90% of Python in 90 Minutes
Learn 90% of Python in 90 Minutes
 

More from Yoshiki Satotani

Basic practice of R
Basic practice of RBasic practice of R
Basic practice of R
Yoshiki Satotani
 
Py lecture5 python plots
Py lecture5 python plotsPy lecture5 python plots
Py lecture5 python plots
Yoshiki Satotani
 
PyLecture4 -Python Basics2-
PyLecture4 -Python Basics2-PyLecture4 -Python Basics2-
PyLecture4 -Python Basics2-
Yoshiki Satotani
 
PyLecture2 -NetworkX-
PyLecture2 -NetworkX-PyLecture2 -NetworkX-
PyLecture2 -NetworkX-
Yoshiki Satotani
 
PyLecture1 -Python Basics-
PyLecture1 -Python Basics-PyLecture1 -Python Basics-
PyLecture1 -Python Basics-
Yoshiki Satotani
 
PyLecture3 -json-
PyLecture3 -json-PyLecture3 -json-
PyLecture3 -json-
Yoshiki Satotani
 

More from Yoshiki Satotani (6)

Basic practice of R
Basic practice of RBasic practice of R
Basic practice of R
 
Py lecture5 python plots
Py lecture5 python plotsPy lecture5 python plots
Py lecture5 python plots
 
PyLecture4 -Python Basics2-
PyLecture4 -Python Basics2-PyLecture4 -Python Basics2-
PyLecture4 -Python Basics2-
 
PyLecture2 -NetworkX-
PyLecture2 -NetworkX-PyLecture2 -NetworkX-
PyLecture2 -NetworkX-
 
PyLecture1 -Python Basics-
PyLecture1 -Python Basics-PyLecture1 -Python Basics-
PyLecture1 -Python Basics-
 
PyLecture3 -json-
PyLecture3 -json-PyLecture3 -json-
PyLecture3 -json-
 

Recently uploaded

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 

Recently uploaded (20)

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 

Basic use of Python (Practice)

  • 1. Basic use of Python -Practice- National Institute of Technology, Anan College, JAPAN Yoshiki Satotani
  • 3. Basic data types • Create following lists with range function. 1. [0, 1, 2, 3, 4] 2. [3, 4, 5, 6, 7] 3. [3, 6, 9, 12, 15, 18] 4. [2, 4, 6, 8, 12, 16, 20] hint: use + operator
  • 4. Basic data types • Create a dictionary that 1. Keys are [0, 1, …, 10] 2. Values are (key) * 2 i.e. d[0]=0, d[1]=2, d[2]=4, …, d[10]=20 Hint: use zip() function
  • 5. 2. Control flow statements
  • 6. Control flow statements practice • For integer variable named ‘x’, • Print ‘fizz’ if x can be divided by 3 • Print ‘buzz’ if x can be divided by 5 (e.g. if x is 10, print ‘buzz’, x is 15, print ‘fizz buzz’) (hint: use % operator(e.g. 10 % 3 = 1, 14 % 5 = 4))
  • 7. Control flow statements practice • Create a list only contains • Multiple of 3 or 5 (3, 5, 6, 9…) • Between 1 and 20 i.e. [3, 5, 6, 9, 10, 12, 15, 18, 20]
  • 8. Control flow statements practice • Find the 10-th Fibonacci sequence • Fibonacci sequence is • 0, 1, 1, 2, 3, 5, 8, … • The next number is found by adding up the two numbers before it(e.g. 5th number 3 = 2 + 1). • Hint: You need to use recursive function
  • 9. 3. Graph with matplotlib
  • 10. Graph practice • Draw the graph of binary entropy function 𝐻 𝑝 = −𝑝log2 𝑝 − 1 − 𝑝 log2 1 − 𝑝 • Hint: use np.log2 to calculate log2