際際滷

際際滷Share a Scribd company logo
The Most Misunderstood Line In Zen Of Python.pdf
text = "This is some generic text"
index = 0
while index < len(text):
print(text[index])
index += 1
text = "This is some generic text"
for character in text:
print(character)
text = "This is some generic text"
[print(character)
for character in text]
text = "This is some generic text"
[print(c) for c in text]
[print(c)
for c in
"This is some generic text"]
The Most Misunderstood Line In Zen Of Python.pdf
Zen of Python
Zen of Python
The Most Misunderstood Line
In
The Most Misunderstood Line In Zen Of Python.pdf
The Most Misunderstood Line In Zen Of Python.pdf
There should be one--
and preferably only one
--obvious way to do it.
There should be one--
and preferably only one
--obvious way to do it.
If there's more than one
way, what's the most
obvious?
The abstractions you
choose communicate
intent to the future
Iteration
Dataclasses vs. Classes
Enumerations vs. Literals
Every choice is an
abstraction
The abstractions you
choose communicate
intent to the future
@PatViaforever
Pat Viafore
Robust Python

More Related Content

Similar to The Most Misunderstood Line In Zen Of Python.pdf (20)

Naive string matching
Naive string matchingNaive string matching
Naive string matching
Abhishek Singh
1. python programming
1. python programming1. python programming
1. python programming
sreeLekha51
Python cheat-sheet
Python cheat-sheetPython cheat-sheet
Python cheat-sheet
srinivasanr281952
An Introduction : Python
An Introduction : PythonAn Introduction : Python
An Introduction : Python
Raghu Kumar
Basic data types in python
Basic data types in pythonBasic data types in python
Basic data types in python
sunilchute1
I1
I1I1
I1
Maulik (N.) Shah
Functions, List and String methods
Functions, List and String methodsFunctions, List and String methods
Functions, List and String methods
PranavSB
Python tutorial
Python tutorialPython tutorial
Python tutorial
nazzf
Python tutorial
Python tutorialPython tutorial
Python tutorial
Shani729
app4.pptx
app4.pptxapp4.pptx
app4.pptx
sg4795
Python for R developers and data scientists
Python for R developers and data scientistsPython for R developers and data scientists
Python for R developers and data scientists
Lambda Tree
Python Cheatsheet_A Quick Reference Guide for Data Science.pdf
Python Cheatsheet_A Quick Reference Guide for Data Science.pdfPython Cheatsheet_A Quick Reference Guide for Data Science.pdf
Python Cheatsheet_A Quick Reference Guide for Data Science.pdf
zayanchutiya
Python Essentials - PICT.pdf
Python Essentials - PICT.pdfPython Essentials - PICT.pdf
Python Essentials - PICT.pdf
Prashant Jamkhande
mooc_presentataion_mayankmanral on the subject puthon
mooc_presentataion_mayankmanral on the subject puthonmooc_presentataion_mayankmanral on the subject puthon
mooc_presentataion_mayankmanral on the subject puthon
garvitbisht27
Strings in python
Strings in pythonStrings in python
Strings in python
Prabhakaran V M
Introduction to phython programming
Introduction to phython programmingIntroduction to phython programming
Introduction to phython programming
ASIT Education
Lecture10.pdf
Lecture10.pdfLecture10.pdf
Lecture10.pdf
tmmwj1
Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)
Roy Zimmer
manish python.pptx
manish python.pptxmanish python.pptx
manish python.pptx
ssuser92d141
Python ppt
Python pptPython ppt
Python ppt
Anush verma
Naive string matching
Naive string matchingNaive string matching
Naive string matching
Abhishek Singh
1. python programming
1. python programming1. python programming
1. python programming
sreeLekha51
An Introduction : Python
An Introduction : PythonAn Introduction : Python
An Introduction : Python
Raghu Kumar
Basic data types in python
Basic data types in pythonBasic data types in python
Basic data types in python
sunilchute1
Functions, List and String methods
Functions, List and String methodsFunctions, List and String methods
Functions, List and String methods
PranavSB
Python tutorial
Python tutorialPython tutorial
Python tutorial
nazzf
Python tutorial
Python tutorialPython tutorial
Python tutorial
Shani729
app4.pptx
app4.pptxapp4.pptx
app4.pptx
sg4795
Python for R developers and data scientists
Python for R developers and data scientistsPython for R developers and data scientists
Python for R developers and data scientists
Lambda Tree
Python Cheatsheet_A Quick Reference Guide for Data Science.pdf
Python Cheatsheet_A Quick Reference Guide for Data Science.pdfPython Cheatsheet_A Quick Reference Guide for Data Science.pdf
Python Cheatsheet_A Quick Reference Guide for Data Science.pdf
zayanchutiya
Python Essentials - PICT.pdf
Python Essentials - PICT.pdfPython Essentials - PICT.pdf
Python Essentials - PICT.pdf
Prashant Jamkhande
mooc_presentataion_mayankmanral on the subject puthon
mooc_presentataion_mayankmanral on the subject puthonmooc_presentataion_mayankmanral on the subject puthon
mooc_presentataion_mayankmanral on the subject puthon
garvitbisht27
Introduction to phython programming
Introduction to phython programmingIntroduction to phython programming
Introduction to phython programming
ASIT Education
Lecture10.pdf
Lecture10.pdfLecture10.pdf
Lecture10.pdf
tmmwj1
Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)
Roy Zimmer
manish python.pptx
manish python.pptxmanish python.pptx
manish python.pptx
ssuser92d141

More from Patrick Viafore (13)

Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
Patrick Viafore
User-Defined Types.pdf
User-Defined Types.pdfUser-Defined Types.pdf
User-Defined Types.pdf
Patrick Viafore
Robust Python.pptx
Robust Python.pptxRobust Python.pptx
Robust Python.pptx
Patrick Viafore
Tip Top Typing - A Look at Python Typing
Tip Top Typing - A Look at Python TypingTip Top Typing - A Look at Python Typing
Tip Top Typing - A Look at Python Typing
Patrick Viafore
RunC, Docker, RunC
RunC, Docker, RunCRunC, Docker, RunC
RunC, Docker, RunC
Patrick Viafore
DevSpace 2018 - Practical Computer Science: What You Need To Know Without Th...
 DevSpace 2018 - Practical Computer Science: What You Need To Know Without Th... DevSpace 2018 - Practical Computer Science: What You Need To Know Without Th...
DevSpace 2018 - Practical Computer Science: What You Need To Know Without Th...
Patrick Viafore
Controlling Raspberry Pis With Your Phone Using Python
Controlling Raspberry Pis With Your Phone Using PythonControlling Raspberry Pis With Your Phone Using Python
Controlling Raspberry Pis With Your Phone Using Python
Patrick Viafore
C++17 not your fathers c++
C++17  not your fathers c++C++17  not your fathers c++
C++17 not your fathers c++
Patrick Viafore
Building a development community within your workplace
Building a development community within your workplaceBuilding a development community within your workplace
Building a development community within your workplace
Patrick Viafore
Lambda Expressions in C++
Lambda Expressions in C++Lambda Expressions in C++
Lambda Expressions in C++
Patrick Viafore
BDD to the Bone: Using Behave and Selenium to Test-Drive Web Applications
BDD to the Bone: Using Behave and Selenium to Test-Drive Web ApplicationsBDD to the Bone: Using Behave and Selenium to Test-Drive Web Applications
BDD to the Bone: Using Behave and Selenium to Test-Drive Web Applications
Patrick Viafore
Hsv.py Lightning Talk - Bottle
Hsv.py Lightning Talk - BottleHsv.py Lightning Talk - Bottle
Hsv.py Lightning Talk - Bottle
Patrick Viafore
Controlling the browser through python and selenium
Controlling the browser through python and seleniumControlling the browser through python and selenium
Controlling the browser through python and selenium
Patrick Viafore
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
Patrick Viafore
User-Defined Types.pdf
User-Defined Types.pdfUser-Defined Types.pdf
User-Defined Types.pdf
Patrick Viafore
Tip Top Typing - A Look at Python Typing
Tip Top Typing - A Look at Python TypingTip Top Typing - A Look at Python Typing
Tip Top Typing - A Look at Python Typing
Patrick Viafore
DevSpace 2018 - Practical Computer Science: What You Need To Know Without Th...
 DevSpace 2018 - Practical Computer Science: What You Need To Know Without Th... DevSpace 2018 - Practical Computer Science: What You Need To Know Without Th...
DevSpace 2018 - Practical Computer Science: What You Need To Know Without Th...
Patrick Viafore
Controlling Raspberry Pis With Your Phone Using Python
Controlling Raspberry Pis With Your Phone Using PythonControlling Raspberry Pis With Your Phone Using Python
Controlling Raspberry Pis With Your Phone Using Python
Patrick Viafore
C++17 not your fathers c++
C++17  not your fathers c++C++17  not your fathers c++
C++17 not your fathers c++
Patrick Viafore
Building a development community within your workplace
Building a development community within your workplaceBuilding a development community within your workplace
Building a development community within your workplace
Patrick Viafore
Lambda Expressions in C++
Lambda Expressions in C++Lambda Expressions in C++
Lambda Expressions in C++
Patrick Viafore
BDD to the Bone: Using Behave and Selenium to Test-Drive Web Applications
BDD to the Bone: Using Behave and Selenium to Test-Drive Web ApplicationsBDD to the Bone: Using Behave and Selenium to Test-Drive Web Applications
BDD to the Bone: Using Behave and Selenium to Test-Drive Web Applications
Patrick Viafore
Hsv.py Lightning Talk - Bottle
Hsv.py Lightning Talk - BottleHsv.py Lightning Talk - Bottle
Hsv.py Lightning Talk - Bottle
Patrick Viafore
Controlling the browser through python and selenium
Controlling the browser through python and seleniumControlling the browser through python and selenium
Controlling the browser through python and selenium
Patrick Viafore

Recently uploaded (20)

AIR FILTER system in internal combustion engine system.ppt
AIR FILTER system in internal combustion engine system.pptAIR FILTER system in internal combustion engine system.ppt
AIR FILTER system in internal combustion engine system.ppt
thisisparthipan1
惠悋惡 悋惠悋惶 悋悋愆悋悧 愆悛惠 悋悽惘愕悋悸
惠悋惡 悋惠悋惶 悋悋愆悋悧 愆悛惠 悋悽惘愕悋悸惠悋惡 悋惠悋惶 悋悋愆悋悧 愆悛惠 悋悽惘愕悋悸
惠悋惡 悋惠悋惶 悋悋愆悋悧 愆悛惠 悋悽惘愕悋悸
o774656624
Designing Flex and Rigid-Flex PCBs to Prevent Failure
Designing Flex and Rigid-Flex PCBs to Prevent FailureDesigning Flex and Rigid-Flex PCBs to Prevent Failure
Designing Flex and Rigid-Flex PCBs to Prevent Failure
Epec Engineered Technologies
INTERNET OF THINGSSSSSSSSSSSSSSSSSSSSSSSSS.pptx
INTERNET OF THINGSSSSSSSSSSSSSSSSSSSSSSSSS.pptxINTERNET OF THINGSSSSSSSSSSSSSSSSSSSSSSSSS.pptx
INTERNET OF THINGSSSSSSSSSSSSSSSSSSSSSSSSS.pptx
bmit1
Biases, our brain and software development
Biases, our brain and software developmentBiases, our brain and software development
Biases, our brain and software development
Matias Iacono
AI-Powered Power Converter Design Workflow.pdf
AI-Powered Power Converter Design Workflow.pdfAI-Powered Power Converter Design Workflow.pdf
AI-Powered Power Converter Design Workflow.pdf
Aleksandr Terlo
Common Network Architecture:X.25 Networks, Ethernet (Standard and Fast): fram...
Common Network Architecture:X.25 Networks, Ethernet (Standard and Fast): fram...Common Network Architecture:X.25 Networks, Ethernet (Standard and Fast): fram...
Common Network Architecture:X.25 Networks, Ethernet (Standard and Fast): fram...
SnehPrasad2
GREEN BULIDING PPT FOR THE REFRENACE.PPT
GREEN BULIDING PPT FOR THE REFRENACE.PPTGREEN BULIDING PPT FOR THE REFRENACE.PPT
GREEN BULIDING PPT FOR THE REFRENACE.PPT
kamalkeerthan61
ESIT135 Problem Solving Using Python Notes of Unit-2 and Unit-3
ESIT135 Problem Solving Using Python Notes of Unit-2 and Unit-3ESIT135 Problem Solving Using Python Notes of Unit-2 and Unit-3
ESIT135 Problem Solving Using Python Notes of Unit-2 and Unit-3
prasadmutkule1
Dijkstra Shortest Path Algorithm in Network.ppt
Dijkstra Shortest Path Algorithm in Network.pptDijkstra Shortest Path Algorithm in Network.ppt
Dijkstra Shortest Path Algorithm in Network.ppt
RAJASEKARAN G
Design of cannal by Kennedy Theory full problem solved
Design of cannal by Kennedy Theory full problem solvedDesign of cannal by Kennedy Theory full problem solved
Design of cannal by Kennedy Theory full problem solved
Er. Gurmeet Singh
Dilatometer Test in Geotechnical engineering an over view .pptx
Dilatometer Test in Geotechnical engineering an over view .pptxDilatometer Test in Geotechnical engineering an over view .pptx
Dilatometer Test in Geotechnical engineering an over view .pptx
RaghuramChallaC011
Taykon-Kalite belgeleri
Taykon-Kalite belgeleriTaykon-Kalite belgeleri
Taykon-Kalite belgeleri
TAYKON
-PPT-5-Wind-Energy conversion slides contents
-PPT-5-Wind-Energy conversion   slides contents-PPT-5-Wind-Energy conversion   slides contents
-PPT-5-Wind-Energy conversion slides contents
senthilkumarmamse
AI ppt on water jug problem by shivam sharma
AI ppt on water jug problem by shivam sharmaAI ppt on water jug problem by shivam sharma
AI ppt on water jug problem by shivam sharma
ShivamSharma588604
TASK-DECOMPOSITION BASED ANOMALY DETECTION OF MASSIVE AND HIGH-VOLATILITY SES...
TASK-DECOMPOSITION BASED ANOMALY DETECTION OF MASSIVE AND HIGH-VOLATILITY SES...TASK-DECOMPOSITION BASED ANOMALY DETECTION OF MASSIVE AND HIGH-VOLATILITY SES...
TASK-DECOMPOSITION BASED ANOMALY DETECTION OF MASSIVE AND HIGH-VOLATILITY SES...
samueljackson3773
A Star Algorithm in Artificial intelligence
A Star Algorithm in Artificial intelligenceA Star Algorithm in Artificial intelligence
A Star Algorithm in Artificial intelligence
vipulkondekar
Practice Head Torpedo - Neometrix Defence.pptx
Practice Head Torpedo - Neometrix Defence.pptxPractice Head Torpedo - Neometrix Defence.pptx
Practice Head Torpedo - Neometrix Defence.pptx
Neometrix_Engineering_Pvt_Ltd
Wireless-Charger presentation for seminar .pdf
Wireless-Charger presentation for seminar .pdfWireless-Charger presentation for seminar .pdf
Wireless-Charger presentation for seminar .pdf
AbhinandanMishra30
ESIT135 Problem Solving Using Python Notes of Unit-1 and Unit-2
ESIT135 Problem Solving Using Python Notes of Unit-1 and Unit-2ESIT135 Problem Solving Using Python Notes of Unit-1 and Unit-2
ESIT135 Problem Solving Using Python Notes of Unit-1 and Unit-2
prasadmutkule1
AIR FILTER system in internal combustion engine system.ppt
AIR FILTER system in internal combustion engine system.pptAIR FILTER system in internal combustion engine system.ppt
AIR FILTER system in internal combustion engine system.ppt
thisisparthipan1
惠悋惡 悋惠悋惶 悋悋愆悋悧 愆悛惠 悋悽惘愕悋悸
惠悋惡 悋惠悋惶 悋悋愆悋悧 愆悛惠 悋悽惘愕悋悸惠悋惡 悋惠悋惶 悋悋愆悋悧 愆悛惠 悋悽惘愕悋悸
惠悋惡 悋惠悋惶 悋悋愆悋悧 愆悛惠 悋悽惘愕悋悸
o774656624
Designing Flex and Rigid-Flex PCBs to Prevent Failure
Designing Flex and Rigid-Flex PCBs to Prevent FailureDesigning Flex and Rigid-Flex PCBs to Prevent Failure
Designing Flex and Rigid-Flex PCBs to Prevent Failure
Epec Engineered Technologies
INTERNET OF THINGSSSSSSSSSSSSSSSSSSSSSSSSS.pptx
INTERNET OF THINGSSSSSSSSSSSSSSSSSSSSSSSSS.pptxINTERNET OF THINGSSSSSSSSSSSSSSSSSSSSSSSSS.pptx
INTERNET OF THINGSSSSSSSSSSSSSSSSSSSSSSSSS.pptx
bmit1
Biases, our brain and software development
Biases, our brain and software developmentBiases, our brain and software development
Biases, our brain and software development
Matias Iacono
AI-Powered Power Converter Design Workflow.pdf
AI-Powered Power Converter Design Workflow.pdfAI-Powered Power Converter Design Workflow.pdf
AI-Powered Power Converter Design Workflow.pdf
Aleksandr Terlo
Common Network Architecture:X.25 Networks, Ethernet (Standard and Fast): fram...
Common Network Architecture:X.25 Networks, Ethernet (Standard and Fast): fram...Common Network Architecture:X.25 Networks, Ethernet (Standard and Fast): fram...
Common Network Architecture:X.25 Networks, Ethernet (Standard and Fast): fram...
SnehPrasad2
GREEN BULIDING PPT FOR THE REFRENACE.PPT
GREEN BULIDING PPT FOR THE REFRENACE.PPTGREEN BULIDING PPT FOR THE REFRENACE.PPT
GREEN BULIDING PPT FOR THE REFRENACE.PPT
kamalkeerthan61
ESIT135 Problem Solving Using Python Notes of Unit-2 and Unit-3
ESIT135 Problem Solving Using Python Notes of Unit-2 and Unit-3ESIT135 Problem Solving Using Python Notes of Unit-2 and Unit-3
ESIT135 Problem Solving Using Python Notes of Unit-2 and Unit-3
prasadmutkule1
Dijkstra Shortest Path Algorithm in Network.ppt
Dijkstra Shortest Path Algorithm in Network.pptDijkstra Shortest Path Algorithm in Network.ppt
Dijkstra Shortest Path Algorithm in Network.ppt
RAJASEKARAN G
Design of cannal by Kennedy Theory full problem solved
Design of cannal by Kennedy Theory full problem solvedDesign of cannal by Kennedy Theory full problem solved
Design of cannal by Kennedy Theory full problem solved
Er. Gurmeet Singh
Dilatometer Test in Geotechnical engineering an over view .pptx
Dilatometer Test in Geotechnical engineering an over view .pptxDilatometer Test in Geotechnical engineering an over view .pptx
Dilatometer Test in Geotechnical engineering an over view .pptx
RaghuramChallaC011
Taykon-Kalite belgeleri
Taykon-Kalite belgeleriTaykon-Kalite belgeleri
Taykon-Kalite belgeleri
TAYKON
-PPT-5-Wind-Energy conversion slides contents
-PPT-5-Wind-Energy conversion   slides contents-PPT-5-Wind-Energy conversion   slides contents
-PPT-5-Wind-Energy conversion slides contents
senthilkumarmamse
AI ppt on water jug problem by shivam sharma
AI ppt on water jug problem by shivam sharmaAI ppt on water jug problem by shivam sharma
AI ppt on water jug problem by shivam sharma
ShivamSharma588604
TASK-DECOMPOSITION BASED ANOMALY DETECTION OF MASSIVE AND HIGH-VOLATILITY SES...
TASK-DECOMPOSITION BASED ANOMALY DETECTION OF MASSIVE AND HIGH-VOLATILITY SES...TASK-DECOMPOSITION BASED ANOMALY DETECTION OF MASSIVE AND HIGH-VOLATILITY SES...
TASK-DECOMPOSITION BASED ANOMALY DETECTION OF MASSIVE AND HIGH-VOLATILITY SES...
samueljackson3773
A Star Algorithm in Artificial intelligence
A Star Algorithm in Artificial intelligenceA Star Algorithm in Artificial intelligence
A Star Algorithm in Artificial intelligence
vipulkondekar
Wireless-Charger presentation for seminar .pdf
Wireless-Charger presentation for seminar .pdfWireless-Charger presentation for seminar .pdf
Wireless-Charger presentation for seminar .pdf
AbhinandanMishra30
ESIT135 Problem Solving Using Python Notes of Unit-1 and Unit-2
ESIT135 Problem Solving Using Python Notes of Unit-1 and Unit-2ESIT135 Problem Solving Using Python Notes of Unit-1 and Unit-2
ESIT135 Problem Solving Using Python Notes of Unit-1 and Unit-2
prasadmutkule1

The Most Misunderstood Line In Zen Of Python.pdf