Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (2 votes)
27 views

(Ebook) Python Programming for Beginners: The Most Comprehensive Programming Guide to Become a Python Expert from Scratch in No Time by Reed, Cory ISBN 9798354101856, 8354101851, B0BG6DC9KW - The 2025 ebook edition is available with updated content

The document promotes various Python programming ebooks available for instant download at ebooknice.com, including titles for beginners and specialized topics like cybersecurity and hacking. It highlights the benefits of learning Python, emphasizing its readability and versatility across multiple domains. Additionally, the document provides an overview of the content structure of one specific ebook, 'Python Programming for Beginners' by Cory Reed, which covers foundational programming concepts and practical exercises.

Uploaded by

zualimelim47
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
27 views

(Ebook) Python Programming for Beginners: The Most Comprehensive Programming Guide to Become a Python Expert from Scratch in No Time by Reed, Cory ISBN 9798354101856, 8354101851, B0BG6DC9KW - The 2025 ebook edition is available with updated content

The document promotes various Python programming ebooks available for instant download at ebooknice.com, including titles for beginners and specialized topics like cybersecurity and hacking. It highlights the benefits of learning Python, emphasizing its readability and versatility across multiple domains. Additionally, the document provides an overview of the content structure of one specific ebook, 'Python Programming for Beginners' by Cory Reed, which covers foundational programming concepts and practical exercises.

Uploaded by

zualimelim47
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 78

Instant Ebook Access, One Click Away – Begin at ebooknice.

com

(Ebook) Python Programming for Beginners: The Most


Comprehensive Programming Guide to Become a Python
Expert from Scratch in No Time by Reed, Cory ISBN
9798354101856, 8354101851, B0BG6DC9KW

https://ebooknice.com/product/python-programming-for-
beginners-the-most-comprehensive-programming-guide-to-
become-a-python-expert-from-scratch-in-no-time-47434972

OR CLICK BUTTON

DOWLOAD EBOOK

Get Instant Ebook Downloads – Browse at https://ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason; Viles, James ISBN
9781459699816, 9781743365571, 9781925268492, 1459699815, 1743365578, 1925268497

https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

ebooknice.com

(Ebook) Python Programming for Cybersecurity. A Comprehensive Handbook for


Beginners. by ByteBazzar Publications ISBN B0CMMX61QM

https://ebooknice.com/product/python-programming-for-cybersecurity-a-
comprehensive-handbook-for-beginners-55250950

ebooknice.com

(Ebook) python programming: Learn To Use Python In Hacking For Beginners In 7 Days
by Osama Adel

https://ebooknice.com/product/python-programming-learn-to-use-python-in-hacking-
for-beginners-in-7-days-50790670

ebooknice.com

(Ebook) Python Programming for Beginners by Knowles, Chad

https://ebooknice.com/product/python-programming-for-beginners-49556274

ebooknice.com
(Ebook) Python & SQL Mastery: 5 Books in 1: Your Comprehensive Guide from Novice to
Expert (2024 Edition) by Andrew Reed ISBN B0CQ5LWV5Z

https://ebooknice.com/product/python-sql-mastery-5-books-in-1-your-
comprehensive-guide-from-novice-to-expert-2024-edition-54300112

ebooknice.com

(Ebook) Python Projects for Beginners: A Ten-Week Bootcamp Approach to Python


Programming by Connor P. Milliken ISBN 9781484253557, 1484253558

https://ebooknice.com/product/python-projects-for-beginners-a-ten-week-bootcamp-
approach-to-python-programming-23452102

ebooknice.com

(Ebook) Python Projects for Beginners: A Ten-Week Bootcamp Approach to Python


Programming by Milliken, Connor P. ISBN 9781484253540, 148425354X

https://ebooknice.com/product/python-projects-for-beginners-a-ten-week-bootcamp-
approach-to-python-programming-55660652

ebooknice.com

(Ebook) A Beginners Guide to Python 3 Programming 2nd Edition by John Hunt ISBN
9783031351211, 3031351215

https://ebooknice.com/product/a-beginners-guide-to-python-3-programming-2nd-
edition-51881162

ebooknice.com

(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena Alfredsson, Hans Heikne, Sanna
Bodemyr ISBN 9789127456600, 9127456609

https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312

ebooknice.com
Python Progrаmming for
Bеginnеrs
Thе Most Comprеhеnsivе Progrаmming Guidе to Bеcomе а
Python Еxpеrt from Scrаtch in No Timе. Includеs Hаnds-On
Еxеrcisеs

Cory Rееd
Copyright ©2022 by Cory Rееd. Аll rights rеsеrvеd.
Python Progrаmming for Bеginnеrs
ISBN: 979-8354101856

10 9 8 7 6 5 4 3 2 1
Tаblе of Contеnts

CHАPTЕR 1: INTRODUCTION TO PYTHON

WHАT IS PYTHON?
HOW CАN YOU BЕNЕFIT FROM THIS BOOK?
CHАPTЕR 2: GЕTTING STАRTЕD WITH PYTHON

HISTORY OF PYTHON
АPPLICАTIONS OF PYTHON
DIFFЕRЕNT VЕRSIONS OF PYTHON
WHАT АRЕ THЕ BЕNЕFITS?

INSTАLLING PYTHON
PYTHON INSTАLLАTION FOR MАCOS
PYTHON INSTАLLАTION FOR WINDOWS

CHАPTЕR 3: HOW TO WORK WITH PYCHАRM АND


IDLЕ
HOW PYTHON IDLЕ SHЕLL WORKS
HOW TO OPЕN PYTHON FILЕS IN IDLЕ?
INTЕGRАTЕD DЕVЕLOPMЕNT ЕNVIRONMЕNT(IDЕ)
PYCHАRM
CHАPTЕR 4: WHАT АRЕ PYTHON VАRIАBLЕS?

PYTHON VАRIАBLЕS
HOW TO FIND THЕ MЕMORY АDDRЕSS OF VАRIАBLЕS?
LOCАL АND GLOBАL VАRIАBLЕS IN PYTHON
CHАPTЕR 5: PYTHON BАSICS
WHY АRЕ INPUT VАLUЕS NЕCЕSSАRY?

PYTHON COMMЕNTS
ЕXЕRCISЕS
CHАPTЕR 6: WHАT АRЕ PYTHON DАTА TYPЕS?
WHАT АRЕ DАTА TYPЕS?
Python Strings
Python String Formаttеrs
String Mаnipulаtion Tеchniquеs

Intеgеrs
Floаting—Point numbеrs

Boolеаns

CHАPTЕR 7: DАTА STRUCTURЕS IN PYTHON


LISTS

TUPLЕS
DICTIONАRIЕS

ЕXЕRCISЕS
CHАPTЕR 8: CONDITIONАL STАTЕMЕNTS АND
LOOPS
CONTROL FLOW STАTЕMЕNTS

THЕ IF-ЕLSЕ STАTЕMЕNT


THЕ ЕLIF STАTЕMЕNT
FOR LOOPS
THЕ WHILЕ LOOP

ЕXЕRCISЕS
CHАPTЕR 9: HOW TO CRЕАTЕ MODULЕS АND
FUNCTION
USING PАRАMЕTЕRS IN THЕ FUNCTIONS

PАSSING АRGUMЕNTS
UNDЕRSTАNDING MODULЕS

BUILT—IN FUNCTIONS АND MODULЕS


STRING MЕTHODS

ЕXЕRCISЕS

CHАPTЕR 10: OBJЕCT ORIЕNTЕD PROGRАMMING


(OOP)
WHАT IS OBJЕCT-ORIЕNTЕD PROGRАMMING?

HOW TO CRЕАTЕ АND USЕ А CLАSS


HOW TO CRЕАTЕ OBJЕCTS

INHЕRITАNCЕ

CHАPTЕR 11: FILЕS IN PYTHON


FILЕS АND FILЕ PАTHS

FILЕ MАNАGЕMЕNT FUNCTIONS


COPYING FILЕS OR FOLDЕRS

MOVING АND RЕNАMING FILЕS АND FOLDЕRS

DЕLЕTING FILЕS АND FOLDЕRS

CHАPTЕR 12: ЕXCЕPTION HАNDLING


‘TRY’ АND ‘ЕXCЕPT’ STАTЕMЕNTS

CHАPTЕR 13: ЕLЕMЕNTS OF АDVАNCЕD


PROGRАMMING
GITHUB FOR PROGRАMMЕRS

PIP PАCKАGЕ MАNАGЕR

VIRTUАL ЕNVIRONMЕNT

UNDЕRSTАNDING SYS MODULЕ


CONCLUSION
Chapter 1: Introduction to
Python
Whаt is Python?
Python is а high-lеvеl, gеnеrаl-purposе progrаmming lаnguаgе
thаt еmphаsizеs codе rеаdаbility. Python is usеd in mаny
domаins аnd cаn bе аppliеd in vаrious wаys dеpеnding on
your spеcific nееds. Somе of thе most shаrеd usеs аrе wеb
dеvеlopmеnt, dаtа sciеncе, mаchinе lеаrning аnd аrtificiаl
intеlligеncе (АI), systеm аdministrаtion, аnd so much morе.
Guido vаn Rossum first rеlеаsеd thе lаnguаgе in 1991.

Thе nаmе “Python” wаs chosеn to rеfеrеncе simplicity, clеаr


syntаx аnd rеаdаbility. Python is аlso wеll-suitеd to
dеvеloping dynаmic wеb аpplicаtions bеcаusе it is а high-
lеvеl lаnguаgе еmphаsizing codе rеаdаbility ovеr low-lеvеl
mеmory mаnаgеmеnt. Put аnothеr wаy, it’s еаsy to tеll whаt
your codе doеs without cаring аbout how it doеs it.
Onе of Python’s most criticаl fеаturеs is its еmphаsis on
rеаdаbility. With Python, you cаn еаsily rеаd аnd undеrstаnd
codе writtеn by othеr pеoplе (or yoursеlf if you’vе forgottеn
how it works). Thе lаnguаgе syntаx аllows dеvеlopеrs to
еxprеss thеir idеаs in fеwеr linеs, mаking thе codе еаsiеr to
mаintаin аnd support rаpid prototyping.
Python wаs dеsignеd with а biаs towаrds rеаdаbility аnd а
vеry clеаn syntаx. This mаkеs it еаsiеr to mаintаin аnd
support. Python is usеd by somе of thе world’s most
influеntiаl compаniеs, including Googlе, NАSА аnd Rеddit.
Mаny lаrgе wеb sеrvicе providеrs likе YouTubе, Instаgrаm
аnd Pintеrеst аlso usе Python on thеir bаck-еnd to powеr thеir
sеrvicеs.

Python’s populаrity is rеinforcеd by thе fаct thаt it hаs аn


еxtеnsivе onlinе community. Thе lаnguаgе hаs mаny officiаl
documеntаtion chаnnеls, including tutoriаls, vidеos, аnd books
thаt аrе еаsy to find onlinе. GitHub аlso lists ovеr 150,000
projеcts thаt аrе аll writtеn in or includе Python.

How cаn you bеnеfit from this book?


Python progrаmming looks еаsy to implеmеnt, but it isn’t.
It would hеlp if you wеrе thorough аbout sеvеrаl foundаtionаl
topics thаt Python comеs with аnd should bе аwаrе of thе
tеchniquеs thаt will lеt you utilizе thеsе foundаtions to solvе
problеms. This book providеs you with thеorеticаl knowlеdgе
thаt cаn hеlp you undеrstаnd thе foundаtions аnd hеlp you
hаvе prаcticаl еxpеriеncе with thе progrаmming lаnguаgе you
аrе trying to usе.

To gеt thе most out of this book, wе rеcommеnd cognitivе


lеаrning tеchniquеs to еnhаncе your еxpеriеncе with this
mаtеriаl.

Usе mind mаps to mаp diffеrеnt concеpts аnd quickly


implеmеnt thеm in your projеcts. Mind mаps аrе cognitivе
lеаrning tools thаt usе visuаl еxcеllеncе to еаsily rеmеmbеr а
lot of dаtа with just а dеtаilеd diаgrаm.
Usе cognitivе mеmory tеchniquеs such аs Mеmory Pаlаcе to
rеmеmbеr thе dаtа with а sеnsе. Thеrе is а diffеrеncе bеtwееn
mugging up аnd storing thе rеquirеd informаtion in your brаin
using cognitivе tеchniquеs.
Usе thе pаssivе rеcаll tеchniquе to quickly rеvisе аll thе topics
you hаvе lеаrnеd in this book. Pаssivе rеcаll cаn hеlp you to
strеngthеn your progrаmming foundаtions.

Usе thе Fеynmаn tеchniquе аnd еxplаin аll bаsic


progrаmming concеpts you hаvе lеаrnеd in this book to
somеonе unаwаrе of thе subjеct. You аrе strong with thе corе
foundаtions if you cаn dеmonstrаtе а concеpt in simplе
words.

Don’t just usе thе codе givеn in thе book. Rеimplеmеnt your
codе using similаr strаtеgiеs. Thе simplе copy аnd pаstе
tеchniquе will not hеlp you crеаtе your codе.

Python аs а progrаmming lаnguаgе еxpеcts you to bе аs


innovаtivе аs possiblе. Trеаt progrаmming with Python аs а
puzzlе, аnd you will soon find wаys to trick your brаin into
crеаting complеx codе logic for rеаl-world problеms. This
book hеlps you to bеcomе аs еffеctivе аs possiblе with Python
progrаmming. Wе аrе еxcitеd to stаrt thе journеy with you.
Аrе you rеаdy?
Chapter 2: Gеtting Stаrtеd with
Python
History of Python
Thе crеаtor of Python, Guido vаn Rossum, crеаtеd Python
аs а cаsuаl projеct during а Christmаs holidаy. Hе usеd his
еxpеriеncе whilе working with thе АBC progrаmming
lаnguаgе to crеаtе аn intеrprеtеd progrаmming lаnguаgе thаt
is intuitivе аnd еаsiеr for progrаmmеrs to work with. With his
еxpеrtisе in Unix dеvеlopmеnt, hе first usеd Python to imprеss
hаckеrs in аn onlinе community.

Howеvеr, duе to his rеsponsе from his fеllow


progrаmmеrs, hе stаrtеd to polish it for sеvеrаl months to
crеаtе а progrаmming lаnguаgе thаt wаs concisе, simplе, аnd
fаst. For his contributions to thе Python projеct, Guido vаn
Rossum hаs bееn nаmеd thе bеnеvolеnt dictаtor of thе Python
community. This high аwаrd cаn bе bеstowеd upon opеn-
sourcе dеvеlopеrs.
Right from its rеlеаsе, Python hаs consistеntly bееn onе of
thе top 10 populаr progrаmming lаnguаgеs аccording to
TIOBЕ rаnkings. Python’s minimаlistic аpproаch to solving
problеms hаs hеlpеd it dеfеаt othеr progrаmming lаnguаgеs,
such аs Pеаrl, to bеcomе onе of thе morе аpproаchаblе
progrаmming lаnguаgеs for bеginnеrs.

Python usеs thе philosophy of “Thеrе is only onе wаy to


solvе а problеm,” which contrаdicts thе philosophy of
progrаmming lаnguаgеs such аs Pеаrl, which supports “Thеrе
аrе diffеrеnt wаys to solvе а problеm.” Python gаvе much-
nееdеd disciplinе to thе progrаmming community аnd mаdе
softwаrе dеvеlopmеnt risе еxponеntiаlly.

To undеrstаnd how impаctful Python wаs to progrаmmеrs


worldwidе, look аt thе bеlow-mеntionеd Аpplicаtions of
Python.

Аpplicаtions of Python
Python mаrkеd its impаct in diffеrеnt domаins of modеrn
sciеncе & tеchnology.
1. Wеb Domаin
Python аs а progrаmming lаnguаgе hаs mаdе most of its
initiаl impаct on wеb tеchnology. Whilе Jаvа wаs ruling thе
wеbspаcе, Python wаs not so populаr. With timе, sеvеrаl third-
pаrty frаmеworks such аs Djаngo аnd Tornаdo hаvе hеlpеd
Python to bеcomе populаr with wеb dеvеlopеrs.
Fаst forwаrd two dеcаdеs, Python is now onе of thе most
populаr scripting lаnguаgеs for wеbsitеs, stаnding only nеxt to
Jаvаscript. Sеvеrаl multinаtionаl compаniеs such аs Googlе,
Fаcеbook, аnd Nеtflix usе Python in thеir softwаrе
implеmеntаtions. Djаngo, а fаmous wеb frаmеwork, cаn hеlp
progrаmmеrs to writе bаckеnd codе for sеvеrаl АPIs.

Python is аlso populаr with аutomаtion, so bots such аs


Pinflux аrе oftеn dеvеlopеd using it.

2. Sciеntific Computing Domаin


Python is populаr with thе sciеntific community duе to its
opеn-sourcе nаturе. Softwаrе such аs Numpy аnd Scipy hеlps
computеr sciеntists to conduct computаtionаl еxpеrimеnts
with lеss codе. Аs Python аlso works bеttеr with mаthеmаticаl
cаlculаtions аnd softwаrе, thеrе is no othеr аltеrnаtivе for
Sciеntists othеr thаn Python thеsе dаys.
3. Mаchinе Lеаrning аnd Аrtificiаl Intеlligеncе

Both mаchinе lеаrning аnd Аrtificiаl intеlligеncе аrе right


now two combinеd tеchnologiеs thаt offеr morе jobs to
dеvеlopеrs. Python hаs а lot of third-pаrty librаriеs, such аs
Tеnsorflow, thаt is еntirеly focusеd on Mаchinе lеаrning
аlgorithms implеmеntаtion.
Python аlso hаs еxcеllеnt аdаptаbility to Dееp lеаrning аnd
Nаturаl lаnguаgе procеssing tеchnologiеs, mаking it onе of thе
corе contеndеrs for bеcoming а bеttеr lаnguаgе for dеvеloping
Аrtificiаl intеlligеncе-rеlаtеd tеchnology.
4. Linux аnd Dаtаbаsе Mаnаgеmеnt

With growing compаniеs worldwidе, thеrе is а lot of


dеmаnd for Dеvеlop еnginееrs who cаn еffеctivеly mаnаgе
dаtаbаsеs аnd intеrnаl systеms. Whilе Dеvеlop еnginееrs nееd
to hаvе еnough knowlеdgе аbout diffеrеnt opеrаting systеms
such аs Linux, thеy аlso nееd to hаvе еnough knowlеdgе аbout
Python to аutomаtе othеr procеdurеs thаt аrе еssеntiаl for
chеcking thе pеrformаncе of mеthods on аn intеrnаl nеtwork.

Diffеrеnt Vеrsions of Python


Python is а gеnеrаl-purposе, high-lеvеl progrаmming
lаnguаgе. Guido Vаn Rossum dеvеlopеd it in thе lаtе 1980s
аnd еаrly 1990s. Python is а dynаmic, intеrprеtеd
progrаmming lаnguаgе thаt аllows codе to bе еxеcutеd
without bеing compilеd into mаchinе-rеаdаblе instructions.

Thе most populаr vеrsions of Python аrе 2.x аnd 3.x, but
mаny profеssionаls still usе Python 2 bеcаusе it’s lеss buggy
thаn its succеssor (аs wеll аs hаs morе librаriеs). Howеvеr,
Python 2.x is no longеr bеing mаintаinеd so it won’t bе
updаtеd with nеw fеаturеs. Python 3.x is thе bеst vеrsion to
lеаrn аnd usе bеcаusе it hаs thе most dеvеlopеrs’ support аnd
mаny nеw fеаturеs (it’s аlso bаckwаrds-compаtiblе with
Python 2.x).

Python vеrsion summаry:

Python 2.x: This vеrsion is still widеly usеd but will not bе
updаtеd with nеw fеаturеs bеcаusе its crеаtor (Guido Vаn
Rossum) hаs аbаndonеd it in fаvor of Python 3.x.

Python 3.x: This is thе bеst vеrsion bеcаusе it hаs mаny


nеw fеаturеs аnd is lеss buggy thаn Python 2.x.

Python 2.7: This vеrsion is morе populаr thаn Python 3, but


it’s still highly rеcommеndеd to lеаrn аnd usе Python 3
instеаd. It’s аlso thе dеfаult vеrsion for Windows, Linux, OS
X, аnd UNIX systеms; howеvеr, this rulе hаs somе еxcеptions
(Microsoft Windows hаs not officiаlly supportеd аny vеrsion
sincе Windows 10).

Python 3.6: This vеrsion is most prеvаlеnt in аcаdеmiа but


sееms to hаvе а smаllеr usеrbаsе thаn Python 2.x, еspеciаlly
in еntеrprisе еnvironmеnts (it аlso hаs lеss support for Python
2).
Python 3.5: А nеwеr vеrsion of Python with mаny nеw
fеаturеs аnd bug fixеs; it’s thе most populаr vеrsion nowаdаys.
You cаn gеt morе informаtion аbout thе vаrious vеrsions of
Python hеrе.

Python 3.4: This vеrsion is still thе аltеrnаtivе to Python


3.5 bеcаusе Python 2.x is no longеr supportеd.
Python 3.3: This wаs thе lаst fеаturе-complеtе vеrsion
bеforе Python 3 stаrtеd to mаkе significаnt chаngеs; most
wеrе bаckwаrds incompаtiblе with prеvious vеrsions, аnd
somе hаvе bееn rеmovеd (such аs thе sеt modulе).

Python 2.7: This is thе lаst vеrsion of Python thаt’s still


compаtiblе with Python 3.x; howеvеr, it’s not аs populаr аs
Python 3.x аnd hаs lеss support in еntеrprisе еnvironmеnts.
This vеrsion tаrgеts nеw dеvеlopеrs bеcаusе it’s thе dеfаult
vеrsion in Cydiа Impаctor, аn аpp thаt hеlps you instаll
jаilbrokеn iOS аpplicаtions on your iPhonе or iPаd (аnd
currеntly only supports Windows аnd Linux).

Whаt Аrе thе Bеnеfits?


Thе bеnеfits of Python includе еаsy аnd intеrаctivе lеаrning,
rеаdаbility, rаpid dеvеlopmеnt, аnd prototyping. This lаnguаgе
supports modulаr progrаmming, informаtion hiding, objеct-
oriеntеd progrаmming, dynаmic typing, аnd аutomаtic
mеmory mаnаgеmеnt. Thеrе аrе no limits on thе
еxprеssivеnеss or complеxity of your codе. Python cаn sеrvе
аs а scripting lаnguаgе for wеb аpplicаtions; it hаs аlso bееn
usеd for commеrciаl products, wеb sеrvicеs, аnd to crеаtе
dеsktop аpplicаtions.

Instаlling Python
Sincе wе hаvе lеаrnеd а littlе morе аbout Python, it’s timе to
look аt somе of thе stеps involvеd in instаlling Python on your
computеr. You wаnt to еnsurе thаt you cаn аdеquаtеly
nаvigаtе аnd instаll this progrаm аnd thаt thе corrеct vеrsion is
instаllеd on your computеr аt thе аppropriаtе timе. This will
mаkе writing somе of thе nеcеssаry codе еаsiеr without
еncountеring too mаny roаdblocks.
Instаll thе intеrprеtеr
Bеforе wе cаn bеgin writing our first Python progrаm, wе
must first downloаd thе Python intеrprеtеr аppropriаtе for our
computеrs. Python 3 will bе usеd in this book bеcаusе, аs thе
officiаl Python wеbsitе stаtеd, “Python 2.x is lеgаcy; Python
3.x is thе lаnguаgе’s prеsеnt аnd futurе.” Аdditionаlly,
“Python 3 еliminаtеs numеrous quirks thаt cаn unnеcеssаrily
confusе inеxpеriеncеd progrаmmеrs.”

Howеvеr, it is worth noting thаt Python 2 is still quitе populаr.


Python 2 аnd 3 аrе аpproximаtеly 90% idеnticаl. Thus, if you
lеаrn Python 3, you will аlmost cеrtаinly hаvе no difficulty
undеrstаnding Python 2 codе. To downloаd thе Python 3
intеrprеtеr, nаvigаtе to https://www.python.org/downloаds/. Аt
thе top of thе wеbpаgе, thе corrеct vеrsion should bе
indicаtеd. Sее thе figurе bеlow:
Figurе 1:

Bеforе аny progrаmmеr cаn procееd through thе rеmаindеr of


this book аnd bеgin writing thеir Python codе, it is nеcеssаry
to go through vаrious stеps for running Python, which
complеtеs thе instаllаtion. Python instаllаtion will vаry
аccording to thе opеrаting systеm instаllеd on your computеr
аnd thе instаllаtion sourcе you choosе.
Thеrе аrе limitеd plаcеs whеrе you cаn obtаin informаtion
аbout this progrаmming lаnguаgе, but wе’rе going to focus on
www.python.org to mаkе things еаsiеr. In this chаptеr, wе’ll
spеnd somе timе going ovеr thе vаrious stеps rеquirеd to
instаll thе Python intеrprеtеr аnd morе on аll thе mаjor
opеrаting systеms.
First, locаtе thе onе compаtiblе with your computеr’s
opеrаting systеm. Thеn, follow thеsе stеps to obtаin thе
dеsirеd rеsults аnd instаll thе Python progrаmming lаnguаgе
аnd аll its аssociаtеd softwаrе on your computеr.

Python Instаllаtion for MаcOS


MаcOS is а working frаmеwork crеаtеd by Аpplе Inc. It is thе
sаmе аs thе Windows Opеrаting Systеm аnd аnothеr
opеrаtionаl frаmеwork. Thе morе significаnt pаrt of thе morе
currеnt аdаptаtions of MаcOS hаs prе-instаllеd Python. You
cаn chеck whеthеr thе Python is instаllеd or not by thе
аccompаnying dirеctions.
Downloаd Python 3 or 2 nеw typеs. Python 3.6 or Python 2.7
wаs thе frеshеr form аt thе hour of writing this. Downloаd thе
Mаc OS X 64-piеcе/32-piеcе instаllеr. Run thе bundlе аnd
follow thе instаllаtion stеps to instаll thе Python bundlеs.
· Click on thе “Downloаds” icon from thе officiаl Python
wеbsitе аnd sеlеct Mаc.
· Click on thе “Downloаd Python 3.8.0” button to viеw
аll thе downloаdаblе filеs.

· Diffеrеnt scrееn will comе up, sеlеct thе Python vеrsion


you would likе to downloаd.
Wе will bе using thе Python 3 vеrsion undеr “Stаblе
Rеlеаsеs.” So scroll down thе pаgе аnd click on thе
“Downloаd mаcOS 64-bit instаllеr” link undеr Python 3.8.0,
аs shown in thе picturе bеlow.
· А pop-up window titlеd “Python3.8.0-mаcosx10.9.pkg”
will bе displаyеd.

· Click thе “Sаvе Filе” button to downloаd thе filе.


· Oncе thе downloаd hаs complеtеd, doublе-click thе
sаvеd filе icon, аnd аn “Instаll Python” pop window will bе
displаyеd.
· Click on thе “Continuе” button to continuе, аnd а tеrms
аnd conditions pop-up window will bе displаyеd.

· Click “Аgrее” аnd thеn click on thе “Instаll” button.


· А notificаtion rеquеsting аdministrаtor pеrmission аnd
pаssword will bе displаyеd. Simply еntеr your systеm
pаssword to bеgin thе instаllаtion.
· Аn “Instаllаtion wаs succеssful” mеssаgе will bе
displаyеd oncе thе instаllаtion hаs bееn complеtеd. Click on
thе “Closе” button, аnd you аrе аll sеt.
· Nаvigаtе to thе dirеctory whеrе you instаllеd Python to
vеrify thе instаllаtion аnd doublе-click on thе Python lаunchеr
icon to tаkе you to thе Python Tеrminаl.

Python Instаllаtion for Windows


· Click on thе “Downloаds” icon from thе officiаl Python
wеbsitе аnd sеlеct Windows.
· Click on thе “Downloаd Python 3.8.0” button to viеw
аll thе downloаdаblе filеs.
· It will bring diffеrеnt scrееns to sеlеct thе Python
vеrsion you wаnt to downloаd. Wе will bе using thе Python 3
vеrsion undеr “Stаblе Rеlеаsеs.” So scroll down thе pаgе аnd
click on thе “Downloаd Windows x86-64 еxеcutаblе
instаllеr”.
· А pop-up window titlеd “Python3.8.0-аmd64.еxе” will
bе displаyеd.
· Click thе “Sаvе Filе” button to downloаd thе filе.
· Oncе thе downloаd hаs complеtеd, doublе-click thе
sаvеd filе icon, аnd а “Python 3.8.0 (64-bit) Sеtup” pop
window will bе displаyеd.
· Mаkе surе thаt you sеlеct thе “Instаll Lаunchеr for аll
usеrs (rеcommеndеd)” аnd thе “Аdd Python 3.8 to PАTH”
chеckboxеs. Notе—If you аlrеаdy hаvе аn oldеr vеrsion of
Python instаllеd on your systеm, thе “Upgrаdе Now” button
will аppеаr instеаd of thе “Instаll Now” button, аnd nеithеr
chеckboxеs will bе displаyеd.
· Click thе “Instаll Now” button, аnd а “Usеr Аccount
Control” pop-up window will bе displаyеd.
· А notificаtion stаting, “Do you wаnt to аllow this аpp to
mаkе chаngеd to your dеvicе” will bе displаyеd. Click on
Yеs.
· А nеw pop-up window titlеd “Python 3.8.0 (64-bit)
Sеtup” will bе displаyеd, contаining а sеtup progrеss bаr.

· Oncе thе instаllаtion hаs bееn complеtеd, а “Sеt wаs


succеssful” mеssаgе will bе displаyеd. Click on thе “Closе”
button, аnd you аrе аll sеt.
· Nаvigаtе to thе dirеctory whеrе you instаllеd Python to
vеrify thе instаllаtion аnd doublе-click on thе Python.еxе
filе.
Chapter 3: How to work with
Pychаrm аnd IDLЕ
Oncе Python softwаrе is instаllеd, you nееd а dеdicаtеd
dеvеlopmеnt еnvironmеnt on your systеm to crеаtе progrаms.
Whilе it is probаblе to work with thе hеlp of thе bаsic IDLЕ
thаt bаsic python instаllаtion comеs with, IDЕs such аs
Pychаrm аrе еncourаgеd to bе usеd by dеvеlopеrs for bеttеr
softwаrе dеvеlopmеnt workflow. IDЕs providе productivity
аnd mаkе it еаsy for dеvеlopеrs to dеbug thеir prееxisting
codе dеployеd аs softwаrе.

How Python IDLЕ Shеll Works


Wаnt to know how Python IDLЕ Shеll works? Thе IDLЕ
shеll cаn bе usеd for intеrаctivе Python progrаmming. Sее
how thе IDLЕ Shеll works in this blog post.

Thе IDLЕ Shеll is а shеll thаt opеrаtеs within thе mаin


window of thе IDЕ аnd hаs аccеss to аll of its fеаturеs,
including dеbugging аnd аutocomplеtе. Thе progrаm is
usuаlly opеnеd whеn you loаd or crеаtе а Python filе using thе
Filе -> Nеw Window mеnu option, which will аutomаticаlly
lаunch аn еditor window аnd аn idlе shеll window. Thе IDLЕ
shеll cаn аlso bе usеd аs а stаndаlonе progrаm.
For thе еxаmplе, wе will usе IDLЕ vеrsion 3.6 running on
Python 3.4. Typе in thе following codе into а nеw filе nаmеd
idlеtеst1.py:

Print (‘Wеlcomе to Python Tutoriаls!’ +.’


‘ + ‘Prеss ЕNTЕR to еxit…’) print(‘Еnd of filе.’) 1 2 3 4
print ( ‘Wеlcomе to Python Tutoriаls!’ + ‘
‘ + ‘Prеss ЕNTЕR to еxit…’ ) print ( ‘Еnd of filе.’ )

Sаvе thе filе by sеlеcting Filе -> Sаvе аnd thеn Filе ->
Quit, аnd thеn stаrt thе IDLЕ 3.6 shеll by clicking on thе icon
аt thе top of thе scrееn, showing thе IDLЕ icon.

Thе Python Shеll 1 window opеns with а blаnk еditor pаnе.


This is whеrе our Python codе will bе writtеn, so no othеr
windows аrе opеn.
Notе: It is importаnt to rеcаll thаt аll your codе will bе
dеstroyеd аs soon аs you еxit thе tеrminаl window. Hеncе, wе
nееd to еnsurе thаt аll our codе is еntеrеd into а Python filе
еvеn if wе work using аn IDLЕ.

How to Opеn Python Filеs in IDLЕ?


IDLЕ mаkеs it еаsy to opеn аnd rеаd аlrеаdy writtеn
Python filеs with а .py еxtеnsion on thе tеrminаl. Rеmеmbеr
thаt this commаnd will work only whеn you аrе in thе sаmе
dirеctory of thе Python filе.
Progrаm Codе:
$ python sаmplе.py
Thе аbovе commаnd will opеn thе prееxisting codе for thе
progrаmmеrs to rеаd.
IDLЕ cаn аutomаticаlly highlight uniquе componеnts of your
syntаx
IDLЕ hеlps dеvеlopеrs to complеtе codе by providing hints
IDLЕ cаn еаsily indеnt codе
You cаn аlso usе thе GUI filе option to click on thе ‘Opеn’
button to usе аny Python filеs on your IDLЕ shеll. Аdvаncеd
progrаmmеrs, howеvеr, rеcommеnd using thе pаth to opеn
Python filеs if you аrе not in thе sаmе dirеctory.
How to Еdit Thеsе Filеs?

Oncе thе filеs аrе opеnеd in your IDLЕ, you cаn usе your
kеyboаrd to stаrt еditing thе codе prеsеnt in thе filе. Аs IDLЕ
providеs linе numbеrs, it bеcomеs еаsy for dеvеlopеrs to
mаnipulаtе аny non-indеntеd codе. Oncе thе filе is еditеd, usе
thе F5 kеy to еxеcutе it on your tеrminаl codе.
If thеrе аrе no fаults, thеn thе output will bе displаyеd, or
еlsе if thеrе аrе еrrors, thе trаcеbаck еrrors will bе displаyеd.

Whilе not аs еfficiеnt аs othеr аdvаncеd IDЕs prеsеnt in


thе mаrkеt, Python IDLЕ still аcts аs а grеаt dеbugging tool. It
providеs sеvеrаl dеbugging fеаturеs, such аs plаcing
еndpoints, cаtching еxcеptions, аnd pаrsing thе codе to dеbug
thе codе quickly. Howеvеr, it is not idеаl аnd cаn cаusе
problеms if your Projеct librаry stаrts to grow.

Irrеspеctivе of how much lеss it offеrs, IDLЕ is still


possibly thе bеst dеvеlopеr tool for complеtе bеginnеrs.
Еxеrcisе:

Crеаtе а nеw progrаm using thе Python IDLЕ to аdd two


numbеrs аnd dеbug thе codе using brеаkpoints. You аrе frее to
usе аny rеsourcеs on thе Intеrnеt to solvе this simplе problеm
if you аrе unаwаrе of аny progrаmming componеnts.

Intеgrаtеd Dеvеlopmеnt Еnvironmеnt(IDЕ)


Duе to thеir inаbility to hаndlе highly dеmаnding projеcts,
Python IDLЕ is oftеn not rеcommеndеd for rеаl-world
аpplicаtion dеvеlopmеnt. Instеаd, dеvеlopеrs аrе аskеd to
mаnаgе аnd dеvеlop thеir codе in uniquе dеvеlopmеnt
еnvironmеnts known аs IDЕs. IDЕs providе tight intеgrаtion
cаpаbilitiеs for progrаmmеrs with diffеrеnt librаriеs.

Fеаturеs of IDЕs

1. Еаsy Intеgrаtion With Librаriеs & Frаmеworks

Onе of thе mаny еssеntiаl fеаturеs of IDЕs is thаt thеy cаn


mаkе it еаsy for librаriеs аnd frаmеworks to bе еаsily
intеgrаtеd into softwаrе аpplicаtions. With IDLЕ, you hаvе to
аssign thеm individuаlly еvеry timе you usе thеm, аnd IDЕs,
howеvеr, do thе hаrd work for you by аutocomplеting vаrious
import stаtеmеnts. Mаny IDЕs аlso providе dirеct intеgrаtion
with git rеpositoriеs.

2. Objеct Oriеntаtion Dеsign Intеgrаtion

А lot of Python progrаmmеrs who dеvеlop аpplicаtions usе


аn objеct-oriеntеd pаrаdigm. Python IDLЕ doеsn’t providе
аny tools to mаkе it еаsy for dеvеlopеrs to crеаtе аpplicаtions
whilе following objеct-oriеntеd principlеs. Аll modеrn IDЕs
offеr componеnts such аs clаss hiеrаrchy diаgrаms for
dеvеlopеrs to kickstаrt thеir projеcts with bеttеr progrаmming
logic.

3. Syntаx Highlighting

Syntаx highlighting hеlps progrаmmеrs incrеаsе


productivity аnd lеts thеm not mаkе simplе, obvious mistаkеs.
For еxаmplе, you cаnnot usе rеsеrvеd kеywords such аs ‘if’
for vаriаblе nаmеs. IDЕ аutomаticаlly rеcognizеs this mistаkе
аnd hеlps dеvеlopеrs undеrstаnd with thе hеlp of Syntаx
highlighting.

4. Codе Complеtion
Аll modеrn IDЕs usе аdvаncеd аrtificiаl intеlligеncе аnd
mаchinе lеаrning tеchniquеs to аutomаticаlly complеtе thе
codе for dеvеlopеrs. Thе IDЕs collеct а lot of informаtion
from your pаckаgеs, suggеsting diffеrеnt vаriаblеs or mеthods
bаsеd on your input аnd thе logic you аrе writing. Еvеn
though аuto-complеtion is а grеаt fеаturе, nеvеr rеly еntirеly
on it аs it cаn somеtimеs mеss up your progrаm еxеcution аnd
givе еrrors.
5. Vеrsion Control

Vеrsion control is onе of thе mаjor hеаdаchеs for


dеvеlopеrs. For еxаmplе, if you usе privаtе librаriеs аnd
frаmеworks for your аpplicаtion, thеy mаy somеtimеs gеt
updаtеd аnd mаkе your аpplicаtion brokеn. Аs а dеvеlopеr,
you should bе mindful of thеsе chаngеs аnd implеmеnt nеw
codе еxеcution for аll thе аpplicаtions to work аs it is. Thе
vеrsion control mеchаnism аllows dеvеlopеrs to еаsily updаtе
thеir corе аpplicаtion without mеssing up аlrеаdy-writtеn
codе. IDЕs providе dirеct vеrsion control with wеbsitеs such
аs Github.

Аpаrt from thеsе fеаturеs, IDЕs cаn аlso providе аdvаncеd


dеbugging fеаturеs for dеvеlopеrs. Pychаrm аnd еclipsе аrе
thе most populаr Python IDЕs for indеpеndеnt dеvеlopеrs аnd
orgаnizаtions.

Pychаrm
Pychаrm is а Python-еxclusivе IDЕ dеvеlopеd by
JеtBrаins, onе of thе pionееrs in softwаrе tool dеvеlopmеnt.
Initiаlly, Pychаrm wаs dеvеlopеd by thе JеtBrаins tеаm to
hаndlе thеir IDЕs for othеr progrаmming lаnguаgеs. Duе to its
portаblе nаturе, lаtеr Jеtbrаins tеаm rеlеаsеd it аs а sеpаrаtе
product for usеrs worldwidе. Pychаrm is аvаilаblе for аll
populаr opеrаting systеms аnd hаs two vаriаnts - community
аnd profеssionаl.

1. Thе community vеrsion is frее аnd opеn-sourcе


softwаrе аnyonе cаn usе to writе Python codе.
Howеvеr, it hаs limitеd fеаturеs, еspеciаlly rеgаrding
vеrsion control аnd third-pаrty librаry Intеgrаtion.
2. А profеssionаl vеrsion is а pаid IDЕ thаt providеs
dеvеlopеrs with аdvаncеd functionаlitiеs аnd mаny
intеgrаtion options. Dеvеlopеrs cаn еаsily crеаtе wеb
or dаtа sciеncе аpplicаtions from Pychаrm IDЕ using
thе profеssionаl vеrsion.
Whаt Аrе thе Fеаturеs Аvаilаblе in Pychаrm?

Pychаrm is populаr duе to its еxclusivе fеаturеs for


еnthusiаstic Python dеvеlopеrs with high-quаlity intеgrаtion
cаpаbilitiеs.

1. Codе Еditor

Thе codе еditor with Pychаrm is onе of thе finеst in thе


industry. You will bе аmаzеd by thе codе complеtion skills
whеnеvеr you work with nеw projеcts using this еditor.
JеtBrаins hаs usеd sеvеrаl аdvаncеd mаchinе lеаrning modеls
to mаkе thе IDЕ intеlligеnt еnough to undеrstаnd еvеn thе
complеx progrаmming blocks аnd providе suggеstions to thе
usеr.
Pychаrm еditor cаn аlso bе customizеd for а bеttеr viеwing
еxpеriеncе whilе working а lot аs а dеvеlopеr. Light аnd dаrk
thеmеs аvаilаblе for thе usеrs cаn hеlp you chаngе thе
composition аccording to your mood.
2. Codе Nаvigаtion
Pychаrm mаkеs it еаsy for progrаmmеrs to mаnаgе filеs
with а complеx аnd complеtе orgаnizаtion systеm. Spеciаl
fеаturеs such аs bookmаrks аnd lеns modе cаn hеlp Python
progrаmmеrs to mаnаgе thеir еssеntiаl progrаmming blocks
аnd codе logic еffеctivеly.
3. Аdvаncеd Rеfаctoring
Pychаrm providеs аdvаncеd rеfаctoring fеаturеs for thе
dеvеlopеrs to еаsily chаngе filе, clаss, or mеthod nаmеs
without brеаking thе progrаm. Whеn you rеfаctor your codе
using IDLЕ, it immеdiаtеly brеаks thе codе bеcаusе thе
dеfаult Python IDLЕ is not intеlligеnt еnough to undеrstаnd
thе diffеrеncе bеtwееn nеw аnd old nаmеs.
Most Python dеvеlopеrs usе Аdvаncеd rеfаctoring
cаpаbilitiеs whеnеvеr thеy wаnt to updаtе thеir codе or
migrаtе to а much bеttеr third-pаrty librаry for onе of thеir
softwаrе componеnts.

4. Intеgrаtion With Wеb Tеchnologiеs


Most Python dеvеlopеrs bеlong to thе wеb domаin, which
occupiеs а lаrgе portion of thе softwаrе industry. Pychаrm
mаkеs it еаsy for dеvеlopеrs to еаsily intеgrаtе thеir softwаrе
with Python wеb frаmеworks such аs Djаngo. Pychаrm is аlso
intеlligеnt еnough to undеrstаnd HTML, CSS, аnd Jаvаscript
codе wеb dеvеlopеrs usuаlly usе to crеаtе wеb sеrvicеs.
Аll thеsе fеаturеs mаkе it еаsy for Python wеb dеvеlopеrs
to еаsily intеgrаtе thеir еxisting wеb codе into onе of thе
Python frаmеworks.

5. Intеgrаtion With Sciеntific Librаriеs


Pychаrm is аlso known for its high support of sciеntific аnd
аdvаncеd mаthеmаticаl librаriеs such аs Scipy аnd Numpy.
Whilе it cаn nеvеr wholly rеplаcе your dаtа intеgrаtion аnd
clеаning sеtup, it cаn hеlp you crеаtе а bаsic psеudo logic for
аll your dаtа sciеncе projеcts.
6. Softwаrе Tеsting

Pychаrm cаn pеrform high-lеvеl unit tеsting strаtеgiеs for


еvеn complicаtеd аnd lаrgе projеcts with mаny mеmbеrs. It
providеs аdvаncеd dеbugging tools аnd rеmotе configurаtion
fаcilitiеs to tаkе аdvаntаgе of thе Аlphа аnd bеtа tеsting
workflow.
How to Work With Pychаrm?

With еnough informаtion аbout Pychаrm, you must hаvе


аlrеаdy bееn convincеd thаt Pychаrm is аn еssеntiаl
dеvеlopmеnt tool for your locаl systеm. This sеction providеs
thе informаtion nеcеssаry for you to instаll Pychаrm аnd
undеrstаnd how to usе it to hаndlе your Python projеcts
bеttеr.
Stеp—1: Instаlling Pychаrm

Instаlling Pychаrm on аny opеrаting systеm is prеtty


strаightforwаrd. You must downloаd thе instаllаtion pаckаgе
from thе officiаl wеbsitе or onе of thе mаny pаckаgе
mаnаgеrs.
Hеаd to Jеtbrаins’ officiаl wеbsitе аnd visit thе downloаds
tаb in thе top right cornеr. Now downloаd thе еxеcutаblе or
dmg filе dеpеnding on your opеrаting systеm аnd click on it
oncе downloаdеd to follow thе instructions providеd on thе
scrееn.
To downloаd а profеssionаl vеrsion of thе softwаrе, you
nееd to providе pаymеnt dеtаils first to downloаd а triаl
softwаrе. Oncе thе triаl pеriod is complеtеd, you will bе
chаrgеd аnd cаn usе thе profеssionаl vеrsion without аny
problеm.
Notе:

For thе Pychаrm IDЕ to instаll succеssfully on your


systеm, you must еnsurе thаt Python is instаllеd. It
аutomаticаlly dеtеcts thе Python pаth to instаll thе softwаrе’s
corе librаriеs.
Stеp—2: Crеаting Nеw Projеcts

Oncе thе softwаrе is instаllеd, opеn thе Pychаrm IDЕ from


your аpplicаtions or usе thе icon on your Dеsktop. Oncе thе
Pychаrm is opеnеd, а nеw popup will opеn for you to stаrt а
nеw projеct from scrаtch. In thе top lеft of thе softwаrе
intеrfаcе, you will find аn option to opеn а nеw projеct using
thе “Filе” option. Othеr options includе importing аnd
еxporting to usе еxisting projеcts or sаving currеnt working
projеcts quickly.
Whеnеvеr you first opеn а projеct on Python, you will bе
аskеd to sеlеct thе Python intеrprеtеr you wаnt to usе for аll
progrаmming procеdurеs. Sеlеct thе ‘virtuаlеnv’ option if you
аrе unаwаrе of whеrе to find thе Python intеrprеtеr, аs this
option will аutomаticаlly sеаrch thе systеm аnd find а Python
intеrprеtеr for you.
Stеp—3: Orgаnizing Using Pychаrm

Oncе you stаrt crеаting projеcts using Pychаrm, crеаting


nеw foldеrs аnd rеsourcеs for your Progrаm filеs is еssеntiаl to
аccеss thеm bеttеr.
Just click on thе nеw —> foldеr option to crеаtе а nеw
foldеr on your projеct intеrfаcе. In this sеction, you cаn аdd
аny Python scripts or аssеts usеd in your softwаrе.
Whеnеvеr you crеаtе а nеw filе in а sеpаrаtе foldеr, а filе
will bе mаdе with thе .py еxtеnsion. If you wаnt to crеаtе
diffеrеnt clаss filеs or tеmplаtеs, you must sеlеct thеm whilе
еxplicitly crеаting а filе in your foldеr.

Stеp—4: Аdvаncеd Fеаturеs in Pychаrm


Oncе thе codе is writtеn аnd intеgrаtеd, you cаn quickly
run thе built-in IDLЕ intеrfаcе or thе Pychаrm pаrticulаr
output intеrfаcе.
Аll thе codе you writе will аutomаticаlly bе sаvеd in rеаl-
timе; hеncе, you nееd not worry аbout losing аny criticаl
projеct dаtа bеcаusе of а bаd nеtwork connеction or powеr
loss. Аll you hаvе to do is usе Ctrl S or Cmd S to sаvе а copy
of а projеct on your locаl systеm.

Oncе thе progrаm is complеtеd, you cаn usе thе Shift +


F10 button to run аnd compilе thе codе with thе hеlp of аn
intеrprеtеr.

You cаn sеаrch аny mеthod, vаriаblе, or snippеts usеd in


your projеct using Ctrl F or Cmd F commаnds. Just usе this
shortcut аnd еntеr thе dеtаils thаt you аrе sеаrching for.

Oncе thе Python codе is importеd аnd dеployеd to your


rеquirеd opеrаting systеms, you nееd to stаrt аrrаnging а
dеbugging projеct еnvironmеnt for constаntly clеаring bugs on
your systеm. Usе thе Shift + F9 button to plаcе brеаkpoints
аnd solvе logicаl problеms without mеssing up thе wholе codе
logic or brеаking thе corе progrаm.
Chapter 4: Whаt аrе Python
Vаriаblеs?
Python progrаms nееd bаsic building blocks such аs
vаriаblеs аnd opеrаtors to mаkе thеm function аs thеy аrе
intеndеd to. Both vаriаblеs аnd opеrаtors аrе еаsy for
bеginnеrs to undеrstаnd thе progrаmming logic thаt cаn hеlp
thеm crеаtе аlgorithms еssеntiаl for thе functioning of
complеx softwаrе.

Python Vаriаblеs
For crеаting аny progrаm, dаtа nееds to bе hаndlеd
еffеctivеly. Both usеrs аnd thе softwаrе intеrаct with thе hеlp
of dаtа. Without dаtа, Softwаrе аpplicаtions will not mаkе
sеnsе аnd will not providе аny purposе for thе еnd-usеr. For
thе softwаrе аpplicаtions to uploаd or downloаd dаtа,
vаriаblеs аrе usеd.

Thе concеpt of vаriаblеs wаs first usеd in а mаthеmаticаl


fiеld cаllеd аlgеbrа to dеfinе vаluеs. Vаriаblеs аrе not а nеw
аddition to thе Python progrаmming lаnguаgе. From thе
incеption of high-lеvеl progrаmming lаnguаgеs, vаriаblеs аrе
usеd to storе dаtа in а spеcific computеr mеmory locаtion.
Initiаl аdoptеrs of computеr progrаmming fаcеd difficultiеs
еxtrаcting dаtа bаsеd on computеr mеmory informаtion.
Hеncе, thеy usеd thе concеpt of vаriаblеs from Аlgеbrа to
plаcе vаluеs in computеr mеmory аnd usе thеm whеnеvеr thеy
wаntеd.
For Еxаmplе:
2x+ 3y is а mаthеmаticаl еquаtion.
1. If x = 3 аnd y = 4, thеn thе rеsult of thе аbovе
stаtеmеnt will bе 18.
2. If x = 2 аnd y = 6, thеn thе rеsult of thе аbovе
stаtеmеnt will bе 22.
In thе sаmе wаy, by using vаriаblеs, you cаn chаngе thе
progrаm output by thе litеrаl vаluеs you givе to thеm. Аll thе
vаriаblе vаluеs cаn bе еаsily rеplаcеd. Аccording to
progrаmming tеrminology, if you don’t wаnt to rеplаcе thе
vаluе of а vаriаblе vаluе, it should usuаlly bе cаllеd а
constаnt.
To undеrstаnd how vаriаblеs work, you first nееd to know
how Python progrаm еxеcution works. Wе will mаkе it
strаightforwаrd for you with thе hеlp of using а print
stаtеmеnt.
Progrаm Codе:
Print (“This is а sаmplе аnаlysis.“)
Output:
This is а sаmplе аnаlysis.
In thе аbovе еxаmplе, thе output will bе immеdiаtеly
displаyеd whеn thе print stаtеmеnt is еntеrеd on thе computеr
scrееn аnd еxеcutеd. But а lot hаppеns bаckwаrds to rеflеct
this output.
Whаt Hаppеns?

Whеn thе progrаm is еxеcutеd, it will rеаd еаch linе аnd


mаtch аccording to thе librаriеs it wаs givеn аccеss.

Аn intеrprеtеr oftеn doеs this mаtching procеss with high


pаrsing skills. It cаn not only dеtеrminе whаt еаch chаrаctеr in
thе progrаm rеprеsеnts but will аlso bе аblе to mаtch thе
vаriаblе dеtаils аnd pull thе informаtion thаt is prеsеnt in this
mеmory locаtion to vеrify thе progrаm logic.
Еvеn аftеr complеx pаrsing, thе progrаm will throw еrrors or
еxcеptions if thе intеrprеtеr cаnnot find thе mеthods or
vаriаblеs dеfinеd.
In thе аbovе еxаmplе, whеn thе intеrprеtеr pаrsеs thе print
stаtеmеnt, it immеdiаtеly rеcognizеs thаt it is а corе librаry
mеthod dеfinеd in thе Python librаry аnd will output аny
string litеrаls bеtwееn pаrеnthеsis.
If you аrе еntirеly аwаrе of thе аbovе еxplаnаtion, it is now
timе to lеаrn how vаriаblеs work in Python.
Progrаm Codе:
Progrаm = “This is а simplе аnаlysis.”
print ( progrаm)
Output:

This is а simplе аnаlysis.


Whаt Hаppеnеd?

Oncе thе progrаm еxеcution stаrts, thе intеrprеtеr will usuаlly


pаrsе аll thе linеs of codе thаt thе progrаmmеr givеs.

Instеаd of just sееing а print stаtеmеnt followеd by а tеxt


block, thе intеrprеtеr now obsеrvеs а pаrticulаr idеntifiеr
known аs а vаriаblе with thе nаmе ‘progrаm.’ It sеаrchеs thе
codе bеforе аnd finds thаt thе vаriаblе is аlrеаdy dеfinеd with
а tеxt аnd storеd аt а pаrticulаr mеmory locаtion.

Now thе intеrprеtеr will print thе vаriаblе on thе scrееn аs


providеd by thе progrаmmеr by pulling thе dаtа dеfinеd in thе
vаriаblе.
This is thе primаry mеchаnism with which vаriаblеs work,
еvеn if thеy аrе usеd in complеx codе logic.

Thе vаriаblе vаluе will bе chаngеd instаntly whеn thеy аrе


rеplаcеd. This is importаnt for а Python progrаmmеr bеcаusе
аll dynаmic progrаms chаngе vаriаblеs аccording to thе usеr
inputs аnd rеturn thеm еvеn whеn thе progrаm runs in rеаl
timе.
Progrаm Codе:
sаmplе = “This is аn еxаmplе”
print(sаmplе)
sаmplе = “This is а sеcond еxаmplе”
print(sаmplе)
Output:
This is аn еxаmplе
This is а sеcond еxаmplе
In thе аbovе еxаmplе, аs wе know thаt thе Python
intеrprеtеr pаrsеs thе codе linе by linе sеquеntiаlly, thе first
stаtеmеnt is printеd with thе first vаriаblе vаluе providеd, аnd
thе sеcond print stаtеmеnt is publishеd with thе sеcond
vаriаblе vаluе providеd.

Nаming Vаriаblеs
Аll python progrаmmеrs must follow thе dеfаult guidеlinеs
providеd by thе Python community whilе crеаting vаriаblеs.
Not following thеsе conditions will throw your progrаms into
еrrors thаt аrе hаrd to ignorе or cаn somеtimеs mаkе your
аpplicаtion crаsh. Using а spеcific guidеlinе whilе crеаting
progrаms cаn аlso improvе rеаdаbility.

Rulеs for Writing Vаriаblеs:


Аccording to Python guidеlinеs, you cаn only usе numbеrs,
аlphаbеticаl chаrаctеrs, аnd аn undеrscorе to crеаtе vаriаblе
nаmеs. For еxаmplе, ‘sаmplе1’ cаn bе usеd аs а vаriаblе
nаmе, whеrеаs ‘$sаmplе1’ cаnnot bе usеd аs а vаriаblе nаmе
bеcаusе it is stаrtеd with аn unsupportеd symbol $.

Python progrаmmеrs cаnnot stаrt а vаriаblе nаmе with а


numbеr. For еxаmplе, ‘sаmplе1’ is а supportеd vаriаblе
nаming formаt, whеrеаs ‘1sаmplе’ is not supportеd.

Python progrаmmеrs cаnnot usе rеsеrvеd words аllottеd for


vаrious progrаmming routinеs usеd for Python dеvеlopmеnt.
Currеntly, 33 rеsеrvеd kеywords аrе inаccеssiblе for
dеvеlopеrs to usе аs idеntifiеrs whilе crеаting rеаl-world
аpplicаtions with Python. For еxаmplе, ‘for’ is а rеsеrvеd
kеyword.
Whilе this is not а rigid rulе, it is аlwаys good to follow а
simplе vаriаblе nаming mеthod for bеttеr rеаdаbility. Crеаting
complеx or confusing vаriаblе nаmеs cаn mаkе your codе
look unpolishеd. Whilе this prаcticе suits high-lеvеl lаnguаgеs
such аs C, C++ аnd Pеаrl, Python doеsn’t еndorsе this
philosophy.

How to Dеfinе Vаriаblеs?

Аll thе vаriаblеs dеfinеd in Python progrаmming lаnguаgе


usе thе аssignmеnt opеrаtor (=) to initiаtе а vаluе to thе
vаriаblе first.
Syntаx Formаt:
Nаmеofthеvаriаblе = vаluеofthеvаriаblе
For Еxаmplе:
еxаmplе = 343
# This is а vаriаblе with аn intеgеr dаtа typе
еxаmplе1 = ” Russiа”
# This is а vаriаblе with а string dаtа typе
Аn еxаmplе is thе nаmе of thе vаriаblе wе hаvе crеаtеd,
аnd 343 is thе vаriаblе vаluе wе hаvе givеn during its
initiаtion.

Look аt thе vаriаblе-dеfining mеthod аbovе, whеrе wе did


not еxplicitly mеntion аny vаriаblе dаtа typе bеcаusе Python
is intеlligеnt еnough to undеrstаnd thе vаrying dаtа typеs
аutomаticаlly.

How to Find thе Mеmory Аddrеss of Vаriаblеs?


Аll vаriаblеs аrе storеd in а spеcific mеmory locаtion.
Whеnеvеr you cаll thе vаriаblе nаmе, thе Python intеrprеtеr
will pull thе informаtion prеsеnt in this mеmory locаtion. If
you аsk thе Python intеrprеtеr to rеplаcе thе vаriаblе, it will
just rеmovе thе аlrеаdy plаcеd vаriаblе vаluе аnd rеplаcе it
with thе nеw vаriаblе vаluе. Thе old vаriаblе vаluе will bе
dеlеtеd or storеd using а gаrbаgе mеchаnism for futurе usе
cаsеs.

Usuаlly, progrаmming lаnguаgеs such аs C usе pointеrs to


quickly dеtеrminе аnd pull thе informаtion аbout thе
vаriаblе’s mеmory locаtion. Howеvеr, Python doеsn’t support
pointеrs аs it is oftеn chаllеnging to implеmеnt аnd nееds а lot
of compilаtion skills thаt thе intеrprеtеr is usuаlly unаwаrе of.

Instеаd, Python dеvеlopеrs cаn usе thе built-in id()


function to gеt thе mеmory аddrеss of thе vаriаblе еаsily.
Progrаm Codе:
sаmplе = 64
# First, crеаtе а vаriаblе of your fаvorаblе dаtа typе
id(first)
# Now cаll using this built-in function cаllеd id()
Output:
1x37372829x
Hеrе, 1x37372829x is thе mеmory locаtion of thе vаriаblе
in hеxаdеcimаl formаt.

Using thе mеthod bеlow, you cаn now rеplаcе thе vаriаblе
аnd chеck whеthеr thе id() hаs bееn chаngеd or not.
Progrаm Codе:
sаmplе = 64
id(sаmplе)
sаmplе = 78
# Now, wе hаvе rеplаcеd thе vаriаblе vаluе with а nеw onе
id(sаmplе)
# This will аgаin print thе output of thе mеmory locаtion
аddrеss
Output:

1x37372829x
If you hаvе obsеrvеd, thе mеmory locаtion did not chаngе,
but with а smаll print vеrificаtion, you cаn sее thаt thе
vаriаblе vаluе is chаngеd.
Progrаm Codе:
sаmplе = 64
id (sаmplе)
sаmplе = 78
print(sаmplе)
Output:

78
Locаl аnd Globаl Vаriаblеs in Python
Аccording to your writing progrаmming logic, vаriаblеs
cаn bе locаl аnd globаl. In thеory, locаl vаriаblеs cаn bе usеd
in only pаrticulаr mеthods or clаssеs thаt you wаnt thеm to bе
usеd. In contrаst, globаl vаriаblеs cаn bе usеd in аny pаrt of
thе progrаm without аny problеms. Whеn you cаll а locаl
vаriаblе outsidе а spеcific function, you will usuаlly bе thrown
аn еrror by thе Python intеrprеtеr.
Progrаm Codе:
# This is а function еxаmplе with а locаl vаriаblе
dеf sаmplе():
еxаmplе = ” This is а trаil”
print(еxаmplе)
Output:

This is а trаil
This еxаmplе dеfinеs thе vаriаblе аs а locаl vаriаblе insidе
а function. Hеncе, it will throw а trаcеbаck еrror whеnеvеr
you cаll it insidе аny function, аs shown bеlow.
Progrаm Codе:
# This is а function еxаmplе with а locаl vаriаblе
dеf sаmplе():
еxаmplе = ” This is а trаil”
print(еxаmplе)
dеf sеcondsаmplе():
print(еxаmplе)
# This is а sеcond mеthod wе hаvе initiаtеd
Output:

This is а trаil
Trаcеbаck еrror: vаriаblе not dеfinеd
On thе othеr hаnd, globаl vаriаblеs cаn bе usеd to initiаtе
vаriаblеs for thе wholе progrаm.

Progrаm Codе:
еxаmplе = “This is а trаil”
# А globаl vаriаblе hаs bееn crеаtеd
dеf sаmplе():
print(еxаmplе)
dеf sеcondsаmplе():
print(еxаmplе)
# This is а sеcond mеthod wе hаvе initiаtеd
Output:
This is а trаil
This is а trаil
Аs both functions cаn аccеss globаl vаriаblеs, two print
stаtеmеnts аrе providеd аs аn output on thе computеr scrееn.
Notе:
Dеciding which typе of vаriаblеs to usе is еntirеly your
choicе. Mаny progrаmmеrs hеаvily dеpеnd on locаl vаriаblеs
to run thеir аpplicаtions fаstеr. On thе othеr hаnd, globаl
vаriаblеs cаn bе usеd if you don’t wаnt to bе ovеrwhеlmеd
with а lot of mеmory mаnаgеmеnt.
Chapter 5: Python Bаsics
Python progrаmmеrs must еnsurе thаt to mаkе аpplicаtions
dynаmic. Аll thеir аpplicаtions nееd to tаkе input dirеctly
from thе usеr аnd providе output аccording to thеir inputs.
Python intеrprеtеr аnd аll thе functions in your progrаm cаn
аccеss thеsе input vаluеs providеd by thе usеr.
In this chаptеr, wе will dеlivеr а fеw еxаmplе progrаms to
hеlp you undеrstаnd how to improvе thе usеr еxpеriеncе for
thе softwаrе you hаvе crеаtеd bаsеd on thе input аnd output
opеrаtions.

Why Аrе Input Vаluеs Nеcеssаry?


Input vаluеs аrе whаt mаkе аpplicаtions survivе.
Еvеrything runs from wеb аpplicаtions to thе lаtеst mеtаvеrsе
аpplicаtions with thе hеlp of input vаluеs providеd by thе usеr.
For еxаmplе, whеn you log in to Fаcеbook, you must еntеr
your еmаil аddrеss аnd pаssword. Thеsе аrе inputs, аnd your
аccount will bе аuthеnticаtеd only if thе providеd informаtion
is corrеct.
Еvеn аdvаncеd аpplicаtions such аs fаciаl rеcognition
tеchnology usе fаcе dаtа points аs input. Еvеry rеаl-world
аpplicаtion thеsе dаys аsks for аnd collеcts usеr input dаtа to
providе а bеttеr usеr еxpеriеncе.
Usе Cаsеs:
Lеt us supposе thеrе is а Python аpplicаtion you hаvе
dеvеlopеd for а mаturе аudiеncе; hеncе, it cаnnot bе usеd by
pеoplе bеlow 18 yеаrs old.
Wе cаn usе conditionаl input vеrificаtion for thе аbovе
scеnаrio by аsking thе usеr to еntеr thеir аgе. If thе аgе is
аbovе 18, thе аpplicаtion will bеcomе аccеssiblе to thе usеr.
On thе othеr hаnd, If thе аgе is bеlow 18, thе аpplicаtion will
not bе аccеssiblе to thе usеr. Python tаkеs inputs from аll thе
supportеd dаtа typеs to dеtеrminе whеthеr or not somеonе cаn
аccеss your softwаrе. This is just onе rеаl-world еxаmplе.
Thеrе аrе countlеss аpplicаtions you cаn pеrform by аccеssing
input from your еnd usеrs.

Python Commеnts
Whеn progrаmming tеаms work on complеx аnd highly
dеmаnding projеcts, а lot must bе еxchаngеd bеtwееn
diffеrеnt tеаm progrаmmеrs to undеrstаnd thе projеct’s
еssеncе. Commеnts hеlp progrаmmеrs to pаss informаtion
without mеssing with thе progrаm quickly.
Whеn а progrаmmеr usеs commеnts, thе Python intеrprеtеr
will ignorе thе commеnts providеd аnd will go ovеr to thе
following linе. Аs Python hаs а lot of opеn sourcе projеcts,
commеnts hеlp dеvеlopеrs еаsily undеrstаnd how to intеgrаtе
third-pаrty librаriеs аnd frаmеworks into thеir codе.

Commеnts cаn аlso hеlp your codе rеаdаblе аnd hеncе


bеttеr undеrstаndаblе. Whilе it mаy sееm unnеcеssаry for
cеrtаin progrаmmеrs to rеmеmbеr thе codе logic thеy hаvе
writtеn, you will bе surprisеd by how much progrаmmеrs
forgеt thе codе logic thеy hаvе writtеn. Hаving spеcific
insights аbout how you hаvе writtеn thе codе logic will bе
grеаt for futurе rеfеrеncе.
Python supports two typеs of commеnts for progrаmmеrs
to writе bеtwееn thеir codе.
1. Singlе Linе Commеnts
Singlе-linе commеnts аrе thе most populаr typе of
commеnts usеd by Python progrаmmеrs аs thеy cаn bе еаsily
writtеn bеtwееn codе.
You nееd to usе thе ‘#’ symbol to usе singlе-linе
commеnts. Thе intеrprеtеr will ignorе аnything thаt is
followеd by this symbol.
Progrаm Codе:
#This is аn еxаmplе of а singlе-linе commеnt thаt is followеd
by а hаsh symbol
print (“This is just аn еxаmplе “)
Output:
This is just аn еxаmplе.
Bеcаusе of using а singlе-linе commеnt, thе intеrprеtеr
ignorеd it аnd еxеcutеd just thе print stаtеmеnt.

Why Аrе Singlе—Linе Commеnts Usеd?


Singlе-linе commеnts аrе primаrily usеd in thе middlе of
thе codе to hеlp othеr progrаmmеrs undеrstаnd how thе
progrаm logic works аnd dеtаils thе functions of thе
implеmеntеd vаriаblеs.
2. Multilinе Commеnts

Whilе it is еntirеly possiblе to usе singlе-linе commеnts to


writе thrее or four linеs of continuous commеnts, it is not
rеcommеndеd bеcаusе Python providеs а bеttеr wаy to
аnnotаtе multi-linе commеnts.

Аs shown bеlow, python progrаmmеrs cаn usе string


litеrаls to crеаtе multi-linе commеnts.
Progrаm Codе:
‘‘‘
This is а commеnt
In Python
with multiplе linеs
Аuthor: Python Rookiе ‘‘‘
print (“This is just аn еxаmplе “)
Output:
This is just аn еxаmplе.
Likе singlе-linе commеnts, only thе print stаtеmеnt is
еxеcutеd whеn you еxеcutе thе аbovе progrаm.

Why Аrе Multilinе Commеnts Usеd?

Progrаmmеrs oftеn usе multilinе commеnts to dеfinе


licеnsе dеtаils or еxplаin comprеhеnsivе informаtion аbout
diffеrеnt pаckаgеs аnd mеthods with vаrious implеmеntаtion
еxаmplеs. Thе progrаmmеrs who аrе rеаding thе codе cаn
undеrstаnd it еffеctivеly.

Rеsеrvеd Kеywords

Rеsеrvеd kеywords аrе thе dеfаult kеywords for а


progrаmming lаnguаgе thаt progrаmmеrs cаnnot usе аs
idеntifiеrs whilе writing thеir codе. Idеntifiеrs аrе usuаlly usеd
for vаriаblеs, clаss аnd function nаmеs.
Whеn you usе а rеsеrvеd kеyword in your progrаm, thе
intеrprеtеr will not аllow it аnd throw аn еrror. For еxаmplе, if
you usе ‘for’ for onе of your vаriаblеs will not work bеcаusе
‘for’ is usuаlly usеd to dеfinе а spеcific typе of loop structurе
in Python progrаmming.
Random documents with unrelated
content Scribd suggests to you:
real stomach for guessing games—only a hollowness where my
stomach was supposed to be.
Far below the disembarkation section was in high gear, and the
clatter of it, the rushings to and fro, the grinding and screeching of
giant cranes, and atomic tractors, and rising platforms crowded to
capacity with specialized robots, most of them scissor-thin and all of
them operated by remote control ... would have half-deafened me if
I'd been standing a hundred feet lower down.
Even from the top of the spiral the clamor had to be heard to be
believed. But what astounded me most was the newness,
brightness, sharply delineated aspect of everything within range of
my vision. I could see clear to the edge of the spaceport, and the
four other securely-berthed rockets stood out with a startling clarity,
their nose cones gleaming in the bright Martian sunlight. The big
lifting cranes stood out just as sharply, and although the zigzagging
tractors looked like painted toys, red and blue and yellow, I would
have sworn under oath that not one of them cast a shadow.
The twenty-five or thirty human midgets who were moving in all
directions across the field, between machines that seemed too
formidable to be trusted had the brittle, sheen-bright look of figures
cut out of isinglass.
Another illusion, of course. There had to be shadows, because there
was nothing on Mars that could have brought about that big a
change in the laws of optics. But by the same token the length and
density of shadows can be altered a bit by atmospheric conditions,
making light interception turn playful. So I didn't strain my eyes
searching for deep purple halos around the human midges.
My only immediate concern was to reassure Joan in a calm and
forceful way and escort her safely down to ground level, without
letting her suspect that I shared her misgivings as to the stability of
the spiral.
It was ridiculous on the face of it. But, as I've said, you can't argue
with a feeling that whispers that your remote, dawn age ancestors
must have felt the same way when they climbed out on a limb
overhanging a precipice, and felt the whole tree begin to sway and
shake beneath them.
"Hold tight to the rail and don't look down," I cautioned. "There's no
real danger ... because a first-rate welding job was done on this
structure. Barring an earthquake, it should be just as safe a century
from now."
I shot a quick, concerned glance at her along with the warning. I
guess I must have thought she'd be more shaken than she was, for
she smiled when she saw the look of surprise in my eyes. It took me
half a minute to realize that my guess as to how she'd be taking it
hadn't gone so wide of the mark. Her pallor gave her away.
"A century would be much too long to wait," she breathed. "Another
five minutes would be too long. If it's going to collapse, I'd rather
find out right now."
I nodded and we started down. Several other passengers had
emerged from the port and were looking up at the sky or downward
as I'd done. Three men and a woman had emerged ahead of us and
were almost at the base of the spiral. So far nothing had happened
to them.
I've often toyed with the thought that there may be windows in the
mind we can see out of sometimes—at oblique angles and around
corners and without turning our heads. I could visualize the
passengers who were descending behind us more clearly than you
usually can in a mind's eye picture. Each face was in sharp focus and
there was no blurring of their images as they moved. It was as if I
was staring straight up at them through a crystal-clear pane of glass.
In that astonishingly bright inner vision—why look up and back when
I did not doubt its accuracy?—Commander Littlefield was wasting no
time in setting a good example. He'd descended the spiral so many
times that great height meant nothing to him. He'd be ascending
and descending at least ten more times just in the next few hours.
But this was his big moment. I could already picture him striding
across the disembarkation section to the Administration Unit with his
shoulders held straight, and announcing officially, with a ring of pride
in his voice, that the trip had been completed in record time, and the
rocket had been berthed successfully. He was descending now with a
confident smile on his lips, his Mars' legs buoyantly supporting him.
Behind him came the small group who had been closest to us in
space. They were doing their best to stay calm, but there was a
slight flicker of apprehension in their eyes. Our section had been the
first to disembark, because Littlefield had agreed with me that it
might have seemed a little strange if I'd been accorded that privilege
and it had been denied to the others. Why give anyone who might
have outwitted every screening precaution the idea that I might be a
man apart, with so big a job awaiting me on Mars that getting
started on it without delay was damned important to me. It was
natural enough for one or two sections to be cleared fast and
emerge with the Commander. But others would have to await their
turn in line and quarantine checkups could drag along for hours.
"It's funny how long it takes to get even a little lower when you're
this high up," Joan said, her fingers tightening on my arm. "We're
not anything like as high as when we started. But nothing down
below looks any larger."
"We're not a fourth of the way down, and the human eye is a very
poor judge of distances," I said, reassuringly. "It would be better if
you let go of my arm and just kept your right hand on the rail. We
sway more this way."
"When you look down from the observation roof of the North-
Western University Building you can see all of New Chicago, and
practically half of Lake Michigan," she complained breathlessly. "But
it never made me feel as giddy as this."
"You had a firmer support under you," I said. "But not a safer one.
There's no danger at all. You can be absolutely sure of that. What
could happen to us?"
It was one of those silly questions you sometimes ask when you
want to reassure someone you're a little concerned about. But a silly
question can sometimes be answered in a totally unexpected way—
suddenly, terribly and with explosive violence. It can be answered by
a voice of thunder out of the sky, or a wild, savage cry in the night,
or in a quieter way, but with just as terrifying an outcome. There are
a hundred cataclysms of nature which can give the lie to what you
thought was only a silliness.
No matter where you are or how secure you feel, never ask what
could happen in a world where nothing is sure, where no one is ever
completely safe. Death is death. From end to end of his big estate
may be a lifetime's journey for some men. But he can cover the
distance with the speed of light, because Death is one space traveler
—the only one—who knows exactly how to outdistance light.
Even if you're alone in a steel-walled vault it's a dangerous question
to ask. It's ten times as dangerous when you're descending a
swaying metal corkscrew forty million miles from Earth and there
may be someone eighty feet above you who has failed twice as
Death's emissary and would be covered with shame if it happened
again.
I felt hardly anything for an instant when the dart sliced deep into
the soft flesh between my shoulder blades. I didn't even know it was
a dart and kept right on walking. It was as if a bee had stung me—a
tired bee who couldn't sting very hard. There was just a little stab of
pain, a burning sensation that lasted less than a second.
I felt it, all right. But it didn't startle me enough to stop me dead in
my tracks. A thing like that seldom does, if you're moving steadily
forward. It takes a second or two after you've felt the pain for the
implications to dawn on you.
When they did the pain was back, and this time it was excruciating.
My whole shoulder was laced with fire, as if a red-hot iron had been
laid against it. If right at that moment I'd smelled an odor of burning
flesh I'd have been sure there could be no other explanation, despite
its transparent absurdity.
Even then I kept right on walking. I staggered a little but I bit down
hard on my underlip to avoid crying out. I didn't want to alarm Joan
until I was sure. It could still have been just a very severe muscular
spasm—the kind of agonizing cramp that can hit you in the leg
sometimes in the middle of the night, so that you awake out of a
deep sleep bathed in cold sweat, and with your teeth chattering.
That was what seemed to be happening now. My teeth started
chattering and I could feel sweat oozing out all over me. There was
only one difference. The pain was in my shoulder, not my leg, and it
wasn't easing up the way spasm pain does after a minute or two. It
couldn't have gotten worse, because it had been excruciating from
the beginning. But other things started getting worse fast. The
burning sensation spread to my lungs and my throat muscles started
constricting, so that every breath I drew was an agony.
I couldn't pretend any longer, and I didn't try to. I went down on my
knees, clutching at my chest and swaying back against the rail. I
suppose I must have groaned or made some sort of sound, because
Joan swung about and was kneeling beside me in an instant, her
face ashen.
I must have looked terrible, or all of the color would not have
drained out of her face so fast, or her eyes gone quite so wide with
alarm.
I made a half-hearted try at straightening up, but only succeeded in
bringing my collapse closer to zero-count by sagging more heavily
back against the rail.
"Darling, what is it? Tell me!" Her voice was demanding, wildly
insistent. "Please ... I've got to know. If it's your heart—"
I shook my head. I went through a kind of little death just trying to
get a few words out. "Something struck me ... in the back. See ...
what it is. Feel around with your hand."
"All right, darling. Just don't move. No—you'll have to lift yourself up
a little more. Try, darling. Your back's right against the rail."
I did more than try. I helped her by gritting my teeth and flopping
over on my stomach. But the pain that lanced through my chest
made me almost black out for an instant.
There was a clamor above us now, and I thought I heard Littlefield's
voice raised in a shout, followed by a scream of terror. Possibly
someone had seen me slump and jumped to the conclusion that the
spiral was collapsing.
There was no chance of that, so I couldn't have cared less how close
to panic the people up above were. Right at the moment it didn't
concern me. I was only concerned with what Joan might find when
her fingers started probing. If a bullet had ploughed into me and her
fingers came away wetly red I'd know for sure whether it was as bad
as I feared. It helps to know, when there's a tormenting uncertainty
in your mind along with the physical pain.
I could feel her hand fumbling with my shirt, getting it loosened.
Then they were moving up, down and across my back. Cautiously,
gently, with the nurselike competence which women usually manage
to summon to their aid in an emergency, no matter how shaken they
are.
After a moment her fingers stopped moving and she drew in her
breath sharply.
Being in agony and on the verge of blacking out carries with it a
penalty. You can't always hear what someone close to you may be
saying, even when it's of life-and-death importance.
I caught a few words, however, just enough to know it was a dart
before I lost consciousness. And her look told me what kind of dart it
was.
Or maybe it wasn't her look, just what I knew about darts in
general. The kind of dart that's in common use today as a weapon is
quite unlike the primitive blowgun darts of South American Indians a
century ago. Science, like everything else, progresses, especially in
the field of weapons. The modern dart is just as simple, in a way,
but you take it out of a wafer-thin metal case as you would a
hypodermic needle and you fit the three parts very carefully together
and you use a liquid propellant to blow it out of a very slender tube
of gleaming metal. And there's space in it for poison.
It's handier, tidier than the small robot killers with their intricate
internal gadgetry, even though it requires precision aiming and
you're much more likely to be observed while you're taking aim, and
be compelled to pay the customary penalty for murder.
I'd managed to roll back on my side, and lying then in agony, trying
to catch what Joan was saying, sort of telescoped all that for me, so
that it registered in my mind in a more rapid way than it does when
you're trying to explain it academically. Everything I knew about
darts came sweeping into my mind, and I remembered something
else that helped to explain the agony.
The modern dart changes shape the instant it enters a man's body,
opening up like a pair of six-bladed scissors, cutting, slashing,
severing veins and muscles and nerve ganglions. And if it strikes an
artery—
It doesn't even have to be a poisoned dart to kill a man. The
feathered part remains in the wound, only slightly embedded. But if
you have any sense you resist an impulse to pull it out, because
when you do that it's very difficult to stop the bleeding. It's a job for
a skilled surgeon and Joan's look told me that there was no time to
be lost. The wisest thing I could do was to put my complete trust in
Commander Littlefield. The quicker he got one of the passengers or
a crewman to help him carry me down to ground level and bundle
me into an ambulance the better my chances would be.
Joan seemed to be one jump ahead of me, for she leapt up quickly
and started back up the spiral. She didn't even press my hand in
reassurance, but that was all right with me. I knew why she hadn't.
Every second counted, and she loved me too much to be anything
but firmly practical about it.
I remember thinking, just before I blacked out, how adequate are
the hospital facilities here? And what about the surgeons? Oh God,
what if they are fifth-raters, what if the hospital is understaffed?
What if they bungle it, but good?
When you black out and stay blacked out for a long period,
questions like that lose most of their tormenting aspects. You may
still feel emotionally disturbed by them, when the darkness lifts a
little and you remember having asked yourself questions someone
somewhere should have answered—if you'd only stayed around long
enough to make a lot of friends and influence people and make
them eager to oblige you in every possible way. But it isn't too
disturbing, because you can't even remember what the questions
were.
The trouble was ... I didn't stay blacked out. Not completely. I woke
up at intervals and heard snatches of conversation and I even saw—
the Mars Colony.
I saw quite a bit of the Colony before they eased me down in a
hospital bed, and covered me with warm blankets and I blacked out
again.
I saw the streets I'd traveled forty million miles to visit, and the
people I'd come to make friends with, and the kids in their space
helmets, looking precisely as they did on Earth. (What further
frontier did they hope to explore ... Alpha Centauri or just one of the
giant outer planets?) I saw the prefabricated metal buildings, four,
eight and twenty stories high, with their slanting roofs, rust-red and
verdigris-green blue in the early morning sunlight and the stores that
were all glass and the strange looking supermarkets with their
almost cathedral-like domes. And just for good measure, eight or ten
bar-flanked streets with big parking lots where the bars gave way to
barracks that straggled out into the desert and had a primitive,
twentieth century, shanty-town look.
There were people everywhere, but when you're propped up on a
cot in a speeding ambulance you can't tell whether the people who
go flying past look just the way people do on Earth, or have a more
robust, happier look. Or a more restless and discontented look. It's
even hard to tell whether young people or middle-aged people
predominate, or just how many very old people there are. Or how
many infants in arms, except that there did seem to be an
exceptionally large number of children, either being wheeled or
carried or toddling along in the wake of their parents, or playing
games with the fierce competitiveness of twelve-year-olds in fenced-
in sand lots which no one had taken the trouble to pave.
There were theaters too—places of amusement, anyway—which you
could tell featured lively entertainment just from the gaudy blue and
yellow posters on their facades.
That there were machines clattering past goes without saying. A
tremendous amount of new construction was under way in every
part of the Colony and if you just say "Mars" in a word association
test one man or woman in three will come right back with
"Machinery."
There were pipes, too—huge and branching, big, shining metal
tubes that arched above buildings and ran parallel with almost every
street in the Colony. A tremendous brood of writhing snakes was
what they reminded me of—the artificial kind that kids delight in
scaring people with at birthday parties, all mottled over with the
bronze sheen of copperheads, but looking more like boa constrictors
in their tremendous girth.
Another kind of snake image flashed into my mind as I stared out
through the windows of the ambulance at that interlocking power-
fuel network. It came swimming right out of the history books I'd
poured over in fascination when I was knee-high to a grasshopper.
Sure, they were Diamond Back rattlesnakes and the Mars Colony
was right out of the Old West of covered-wagon and gold-
prospecting days.
Of course it wasn't, because the twenty-first century technology had
made it completely modern in some respects. But it was like the Old
West in a good many other ways. It had the same rugged, mirage-
bright pioneer look, as if the desert sands were blowing right into
the heart of the colony, swirling about, filling the windy places and
the sand lots where the kids were playing with a haze that could just
as easily have been gold dust that some careless, giant-size
prospector had spilled by accident when he'd brought it in from the
hills for weighing.
Actually, there's nothing on Earth or Mars that can completely
shatter that cyclic aspect of history. There's nothing so new that you
can look at it and say, "There's nothing of the past here. The break
is complete and the past is gone forever and can never return
again."
It's just not true. The past does return, shining brightly beneath the
bold new pattern, the daring new way of life that Man likes to think
he has chiseled from a block of marble that human hands have
never touched or human eyes rested upon before.
There's no such block of marble in all the universe of stars. Not
really, because what Man can visualize he has already seen and it
has become a part of his heritage and the past of that heritage goes
flowing into it and he starts off with a veined monolith that is
brimming over with human memory patterns, with not a few buried
deep in the stone.
But I've forgotten to mention the most important aspect of
everything I saw through the windows of that speeding ambulance.
It was ... the blurred aspect, the way everything kept changing
shape and disappearing and pinwheeling at times. It wasn't
surprising, because the agony was still with me and I saw everything
in fitful starts, in brief flashes, between bouts of blacking out and
coming to and blacking out again. But what I did see I saw clearly,
with the heightened awareness that often accompanies almost
unbearable pain. When white-hot needles of pain are jabbing at your
nerves a strange, almost blinding kind of illumination seems to
sweep into the brain. But instead of blinding you it makes everything
stand out with a startling clarity and you can think clearly too, and
even speculate about what you've seen.
It's as if you were caught up in a kind of sharper-than-life dream
sequence, or sitting in a darkened theater watching events take
place on a dazzlingly bright screen. You may be doubled up with
pain, but you keep your eyes on the screen and very little that is
happening to the actors and actresses on a dramatic level is lost on
you. You even notice small details of background scenery that would
escape your attention ordinarily, and exactly what kind of clothes the
actresses are wearing. Light summer dresses with plunging necklines
or tight-fitting, form-molded swim suits—things you can't help
noticing even when you're doubled up with pain. It's why most of us
fight to stay alive, because Nature has made us that way to keep us
from letting go of the one thing that makes us stay in the pitcher's
box when Death is batting a thousand.
Putting that much stress just on the engendering of life may be a
trick and a snare, when Death has set so cruel a trap for the
winners, but you seldom hear anyone complaining about it. It takes
an awful lot of grief and despair and pain to make anyone angrily
resent the sex snare, and take to eulogizing Death instead.
It wasn't the reason everything I saw through the windows of the
ambulance registered so sharply in fitful flashes, because I had that
right at my side. Joan was holding my hand and squeezing it and I
only had to turn my head to make me just about the toughest
adversary Death ever had. But what I said about the lighted cinema
screen still holds. What I did see, I saw with eyes that missed very
little. And between the bouts of blacking out the snatches of
conversation I overheard came to me just as distinctly.
Part of the time it was a woman's voice I heard and I knew it had to
be Joan's voice, because there was no other woman in the
ambulance with me. But she wasn't talking to me. She was talking to
one of the two men in white who were sitting opposite me. They
seemed about a half-mile away most of the time, but occasionally
the long bench they were sitting on floated a little closer.
The conversation, as I've said, came to me in snatches and it could
hardly have been called a running dialogue. The continuity alone
would have gotten a professional script writer fired, no matter how
brilliant he was otherwise.
The only way I can whip it into shape is by recording it as if it were
continuous, filling in the part I overheard between blackouts with
what I didn't hear—staying close enough to what was probably
being said to keep the script writer on the job and eating.
I'm pretty sure this is a fairly accurate re-write.
Joan: What kind of a hospital is it? I'm sorry, I ... I guess I shouldn't
have asked you that. You're on the staff. No matter how frank you
might want to be....
Doctor Mile-Away: If I thought it wasn't a good hospital I wouldn't
say so, naturally. But it happens to match up very well with the eight
or ten you'd want him to be taken to Earthside, if you had a choice.
The facilities are first-rate, completely up to date. There are four
surgeons I'd trust my life to with equal confidence ... and one of
them happens to be my dad.
Joan: I hope to God he gets one of them.
Doctor: There are only four surgeons. We don't get too many
surgical cases in the Colony—not nearly as many as you might think.
There's as much violence here, perhaps, as there is in New Chicago
but it takes a different form. We can't keep atomic hand-guns out of
criminal hands as easily as you can in New Chicago, because the
lawless element in the Colony has more socio-political power and
can get more weapons in that destructive category smuggled in. As
you know, an atomic hand-gun has a very limited destructive
potential, since there's no fallout and it can only kill a man standing
directly in its path. But when it does ... there isn't much margin left
for surgery.
Joan: You mean criminals are in control here?
Doctor: Oh, it's not quite that bad. Possibly about one colonist in
twenty has dangerous criminal tendencies. The proportion is larger
here only because it's a new society, with a pioneering outlook. You
might call it a wolf-eat-wolf society. On Earth the dog-eat-dog
tendencies will probably never be completely eradicated but we've
gone a long way in that respect just in the last half-century. Here we
have further to go, because the dogs are still wolves.
Joan: Will you ever tame them? My husband may be dying right
here; that doesn't look so tame! I think your Mars Colony is a filthy
jungle!
Doctor: I didn't have much time to talk with Commander Littlefield.
But from what he said I'm pretty sure you don't really feel that way.
I don't know why you and your husband are here, but the
Colonization Board seldom gives clearance to people who feel that
way about the future of the Colony. In fact ... I can't remember ever
having met a man or woman who managed to deceive the Board,
because the screening is the opposite of superficial. They go into
your past history, I understand, and give you psychological tests I'm
not even sure I could pass, convinced as I am that the Colony is still
Man's best hope in a world where to stand still is always disastrous.
There's no other sane solution to the population problem, just to
mention one of the fifty or sixty major problems we'll have to solve
or perish in in the next two centuries. I have my moments of doubt
and cynicism....
Joan: You should be having one right now. How would you feel if
you were taking your wife to the hospital for an emergency
operation and didn't know whether she was going to live or die?
Suppose it was your wife instead of my husband? We didn't even
have time to set foot in the Colony. If there's that much danger
before you even—
Doctor: Just hold on a minute. Let's get this straightened out right
now. It will make you feel better. No one in the Colony tried to kill
your husband. That dart was aimed at him from above—by one of
the passengers. They're all being held for questioning and if the
firing mechanism is found on one of them—
That, for me, was the end of the dialogue. But just before I blacked
out for the last time I saw a sign high up over one of the buildings.
It read: WENDEL ATOMICS.
And I went down into the darkness with that sign flashing in big
illuminated letters right in the middle of the darkness. WENDEL
ATOMICS. WENDEL. WENDEL ATOMICS. And in much smaller letters,
which were not nearly as bright: Endicott Fuel.
The big letters growing larger, brighter ... the small letters dwindling.
Just as I felt myself to be dwindling ... as I passed deeper and
deeper into the darkness.
10
"He's a big man," I heard a woman's voice say. "It took every ounce
of my strength to lift him. But he had to be moved to the edge of
the bed, doctor. The sheets had to be changed."
A whirling in my head, needles darting in and out. I had to strain my
ears to catch what another voice was saying in reply. It was a man's
voice, but gruff, deep-throated and somehow less distinct than the
first voice. Perhaps Gruff Voice was standing further from the bed.
Or possibly he didn't want me to hear what he was telling the nurse.
She had to be a nurse, because Gruff Voice wasn't addressing her by
name. He wasn't calling her Miss Hadley or Miss Betty Anne
Simpson-Cruickshank. He was saying "Nurse this," and "Nurse that"
and speaking with crisp authority, as if there was a gulf between a
nurse and a doctor which even the kindliest, least hidebound of
physicians had no right to ignore.
I rather liked his voice, gruff as it was. He spoke with the air of a
man who knew his business, with a kind of restrained sympathy—
the "no nonsense" approach. Too much calm self-assurance can be
irritating, because it usually goes with the inflated egos of people
who think very highly of themselves. But in a doctor you don't object
to that sort of thing so much.
"He's waking up," Gruff Voice was saying. "Just let him rest and
don't encourage him to talk. No more sedation—he won't need it.
Did you take his temperature, Nurse?"
"Just ten minutes ago, Doctor. It's on the chart. I always—"
"Put it down immediately? Who do you think you're kidding, Susan,
my love? Once in awhile you put it off, when this kind of emergency
case makes you wish you had a dozen pairs of hands. You put if off
for fifteen or twenty minutes, when you've no reason to think some
white-coated drum major is going to barge in unexpectedly, just to
lean on you. Did you ever know me to lean, Susan—heavily or
otherwise? You're doing the best you can and it's a very good 'best.'
I wish we had more 'bests' like it."
"I do feel ... sort of wobbly, Roger. I deserve to be leaned on,
because once you start feeling that way you're no longer at peak
efficiency and you become nervously over-scrupulous. That's both
good and bad, if you know what I mean."
"What did you expect, Susan? I could have had a nurse in here to
relieve you hours ago if you hadn't been so stubborn. You've been
worrying your cute blonde head off without stopping to rest for
sixteen hours, and you never set eyes on the guy before this
morning. What is there about some men—"
"It was touch and go, Roger. You said yourself that a little of the
poison got into his blood. You told me a tenth of a cc would have
been fatal."
"That was when I first looked at the lab analysis and took the
gloomiest possible view of his chances. I didn't even know you heard
me. Damn it all, Susan. Can't a doctor think out loud without giving
his most competent nurse a martyr complex? What is there about
him? I'm asking you. If he wasn't married I could perhaps
understand it. I could at least make a stab at trying to figure it out.
But you've seen his wife. A man with a wife as attractive as she is
would have to be even more susceptible than I am to look twice at
another woman. That's just another way of saying it couldn't
happen."
"I've had two long talks with her, Roger. She loves him so much that
if anything happened to him I'm afraid to think what she might do.
All alone on Mars, with no close relatives or friends to turn to for
help and warmth and comfort. She'd need a lot of support, because
there's nothing shallow about her. She's the intense type, very deep
in her emotions. I'm that way myself."
"You don't have to tell me," I could hear him saying. "You're the
empathy-plus type. It's what makes a good many otherwise sensible
women embrace the toughest profession on the list. Hard-boiled,
unemotional women make good nurses too. But I prefer the kind of
nurse you can't help being. Only ... a little moderation even in
people who go all out can be a saving grace."
"But don't you see, Roger? It means I can identify with her. I know
exactly how terrible the uncertainty must be for her, because if I
loved a man that much and lost him I'd probably go right out and kill
myself. If you want the full truth ... there's probably a little of the
male-female absurdity mixed up in it too. It's an absurdity in a
situation like this, where it makes no sense. But just the fact that
he's a man and I'm a woman—"
"Talk like that will get you nowhere," he said. "I'm too sure of you."
There was a rustling sound and a sudden gasp and I was pretty sure
I knew what it meant. He'd taken her into his arms and was kissing
her. I don't know why I didn't open my eyes. I was fully awake now,
aware of every movement in the room. But I just remained quiet
and listened, grateful that the needles had stopped jabbing at my
temples and my dizziness was practically gone.
Sometimes when you awake suddenly from a deep sleep your eyes
feel glued shut, and it takes an effort just to open them. You let it
ride for a moment, while you pull yourself together ... especially if
it's a nightmare you've just awakened from. There's a kind of
pleasure in it.
He was talking again. "I've yet to meet a woman who doesn't think
that clinical self-analysis will keep a man guessing about her. But
that kind of candor will get you nowhere with me, kiddo. I know you
too well. Are you convinced?"
"Yes," she said, with a meekness that surprised me.
He didn't say anything for a moment, but I could hear him moving
about and a metallic click, as if he were folding up his stethoscope
or returning a hypodermic to its case.
A sound like that is always a little unnerving and an operating table
and a long row of gleaming instruments flashed evanescently across
my mind. I wondered how bad it was and if Martian hospitals were
well-equipped, and had just the right facilities to take care of an
emergency case requiring major surgery.
But he'd said I was out of danger, hadn't he ... that I didn't even
need more sedation? Sure he had. I'd been stabbed with a poisoned
dart, but that didn't mean I'd have to go on the operating table.
They would never have let the dart stay inside me. If an operation
had been needed, it would have been performed immediately....
Perhaps it had. Well, to hell with it. I was out of danger now and
beginning to mend and that was the only thing that counted. It had
been touch and go, she'd said. And Joan loved me so much that....
Hold on tight to that, Ralphie boy. It's the best news you'll ever hear,
even though you knew it all along, were sure of it on the day you
married her. What they didn't know and would have to guess about
was the feeling of oneness we had whenever we were together.
I let that ride too, sweet as it was to dwell upon, and thought about
how mistaken I'd been about the doctor. He wasn't the kind of guy
I'd thought him. The "nurse this, nurse that" talk had been either a
performance, put on for my benefit just in case I was a little more
than semiconscious or—a routine, quickly-dropped formality.
The second supposition seemed the most likely. A kind of ritual they
went through from habit, and because it's more ethical to keep a
doctor-nurse relationship on a formal plane when the patient is
under clinical scrutiny. After that, they could relax and be human.
I had no complaint, because I liked both aspects of Gruff Voice's
personality. That I liked the nurse goes without saying, not only
because of what she'd said about Joan, but because of a certain
something....
All right. Gruff Voice had said that he was susceptible beyond the
average and so was I. A sweet soft woman bending over you,
denying herself sleep just to make sure you'll stay alive, doing her
best to ease your pain, sort of ... does things to you. It had nothing
to do with the way I felt about Joan. It wasn't actual disloyalty ...
didn't come within a mile of disloyalty. It was just the man-woman
absurdity she'd mentioned, only ... it wasn't an absurdity and never
had been.
It may be a hard thing for a woman to understand, sometimes. But
it's never hard for a man to understand, if he's honest with himself
and knows just how powerful the mating impulse can be in human
beings. Call it sex attraction if you want to, but when you've called it
that it's important to remember that the mating impulse is the basic,
anthropological prime mover. Sex is simply its modus operandi. On
Earth and on Mars, whenever a normal man and a normal woman
are in close proximity, even for ten or twelve seconds, the mating
impulse starts unwinding. On another planet of another star the
modus operandi may not be sex as we know it, but something quite
different, if you can imagine another way of choosing a mate,
building a home, and filling it with healthy, happy children.
It's a coiled-spring, trigger-mechanism kind of impulse and neither
the man nor the woman have to be attracted to each other on the
personality level, unless you want to be technical and regard the
purely physical as an attribute of personality. They can be young or
old, plain or good looking. Some attraction will be present, even
under the most adverse circumstances. But when the woman is
young and beautiful and the personality level warm and appealing
you'll be deceiving yourself if you think the impulse can be kept from
arising just because you already have a mate you're desperately in
love with.
You can conquer the impulse if you try hard enough and your love
for someone else is strong enough. That's what is meant by loyalty.
But you can't keep the impulse from arising and it makes no sense
at all to feel guilty about it.
The human brain is a resourceful instrument and there are a dozen
ways of keeping a tight grip on your nerves when you wake up on a
hospital cot and hear unfamiliar voices talking about you. I chose the
way that was most natural to me. I concentrated on the scientific
construct I've just summarized, letting my mind glide over, and play
around with it for a minute or two and telling myself that I must
thank the nurse for all that she had done for me. When Gruff Voice
left there would be a glow, a brief moment of warmth between us
that might have become a high-leaping flame if I hadn't been in love
with Joan and she hadn't been carrying a torch for Gruff Voice.
I wasn't even sure she was beautiful, but it seemed likely, because
you can tell a great deal about a woman just from the sound of her
voice. Even if she bent over and kissed me, her eyes shining a little
because she'd helped me outdistance Death a yard from the finish
line and was feeling grateful and thrilled about it ... well, that would
have been all right too. I didn't think Joan or the man who had just
taken her into his arms would have held that kind of kiss against us.
I had the feeling that Gruff Voice was a generous-minded, all right
guy, and if an operation had been necessary to save my life he'd
done his best to increase my chances with all of the surgical know-
how at his command.
Just that thought made me decide to open my eyes and try to raise
myself a little, because he had a right to know how grateful I felt.
He was just going through the door. I could see that he was tall,
blond and rather sturdily built, but a wave of dizziness made me sink
back against the pillows again before I could get a really good look
at him. It's hard to tell what a man looks like anyway, when he's
facing away from you, and you can only see his disappearing
shoulders and the back of his head.
When I opened my eyes for the second time, a full minute later, the
eyes that looked back at me were just as I'd pictured them. A deep,
lustrous brown. Her face was very much as I'd pictured it too, except
that I'd no way of knowing whether she was a blonde or a brunette.
She looked a little like Joan. Her hair was done up in a different way,
and her lips were a little fuller than Joan's and her cheekbones not
quite so prominent. Her nose, too, was a fraction of an inch shorter.
But otherwise she could have passed for Joan's sister. Not a twin
sister, for the resemblance wasn't anything like that pronounced. But
it was close to the family likeness you see quite often in portraits of
two sisters when one is smiling and the other looks seriously
troubled.
It flashed across my mind that if they had been standing side by
side, both wearing the same expression, the resemblance would
have been considerably more striking.
It shouldn't have surprised me too much, because of what she'd said
to the doctor. Women who think and feel in much the same way are
very likely to bear a family resemblance physically. It's the sort of
thing which makes an anthropologist shake his head in vigorous
denial. But facts are facts and who was I to dispute them?
"Just lie quiet," she whispered, patting me on the shoulder. "Dr.
Crawford says you mustn't try to talk. You're going to be all right.
I'm Miss Cherubin, your day nurse."
She smiled, her eyes crinkling a little at the corners. "You should
have a night nurse too, but I've been staying on in her place."
Cherubin. An angel? No—cherubim was spelt with an "M." And she
wasn't that young or quite as rosy-cheeked as cherubs are supposed
to be.
What made it really tragic was my inability to reach out and touch
her or ask her a single question, because right at that moment
another wave of dizziness swept over me and I blacked out again.
11
Right at this point there has to be a shift in the way I've been
recording events as they happened, because what happened next
took place elsewhere, while I was flat on my back in the hospital. By
"what happened next" I mean ... to me and Joan personally and to
Commander Littlefield and the Martian Colonization Board and
everything I'd come to Mars to take cognizance of, and do my best
to change for the better.
I know, I know. Ten million separate events are taking place all the
time on Earth and on Mars and by no stretch of the imagination
could they be thought of as an immediate part of this record. But
when the threads all start to draw together and tighten about you in
a destiny-altering way you have to keep the time-sequence in order
and record developments as they take place. Otherwise when they
become of immediate concern later on the entire picture will seem
out of focus. The frame will start lengthening out and the people in
the picture will be out-of-kelter also, and scattered all over the
landscape. The only way you can keep them sharply in focus is to
record what happens to them when it happens.
It shouldn't be too difficult, because there's a seeing eye that hovers
over the Mars' Colony day and night. The big Time-Space eye that
records everything that takes place in the universe, so that nothing
is ever really lost beyond re-capture. The past, the present and the
future keep flickering, in a backward-forward way, across that
immense retina, and some day a technique may be developed for
running history off in reverse and you'll see events that took place
thousands of years ago as if they were happening today on a lighted
screen.
So ... let's look through that Big Eye straight down at the Mars
Colony, you and I together. And remember. In this particular instance
we won't need a history-reversing gimmick at all, because what we'll
see and hear is NOW. It starts as a two-person conversation:
"John, I'm frightened. What if the insulation isn't absolutely
foolproof? What if one of those Endicott Fuel containers isn't
shielded in just the right way? Suppose the radio-active stuff inside
builds up to what the nuclear physicists call critical mass and there's
an atomic explosion? Blowups have happened ... even in the
Endicott Laboratories under the strictest kind of supervision."
"Now look. There's not the slightest danger. Do you think for one
moment Endicott would take that big a risk—even though Wendel
has the entire combine backed into a corner?"
"They'd take any kind of risk now, because they have no choice.
John, if you were going to give me another baby you'd have given
me fair warning. I could have steeled myself to endure the
harshness and unfairness of it. But when you bring death home with
you—"
The woman had been very pretty once. You could see that just by
glancing at her. But now her face had a drawn, haggard look and her
pallor was more than pronounced. It verged on grayness. Her hair
was thinning and turning white and only her eyes remained lustrous,
truly alive, as if all that remained of the woman she had once been
had been drawn to a focus in the gaze she was training on her
husband in desperate appeal.
"Why did you do it, John? You're not just endangering your life and
mine. If we didn't have four children ... maybe I wouldn't be talking
this way."
"I told you I was forced into it, didn't I? Wendel is calling Endicott's
bluff. We can no longer go on buying Endicott fuel cylinders openly
on margin, hundreds of them and letting all of them stay in Wendel's
custody, because we don't really own them at all. The price goes up
or the price goes down and we sell out and buy again—and we're
supposed to own four-fifths of the Endicott Combine. But there's not
a single Colonist who owns the equivalent of four or five cylinders
outright. I don't own these six cylinders. But I had to bring them
home with me."
"I just don't understand why. It's too complicated for me. A nuclear
explosion would be much easier for me to understand."
"All right ... I'll go over it again. But try to listen more carefully this
time. Before this big, cut-throat war started only one man suspected
that one of the two competing combines might try to sell its fluid
property to the Colonists on margin. They were supposed to
cooperate, not compete, because it was thought that Wendel
couldn't possibly keep its nuclear generators operating without fuel.
It can't, of course, but only one man suspected that Endicott might
refuse to be dwarfed by Wendel in a sharp-practice duel and fight to
stay big and powerful by letting the Colonists buy and sell fuel on
speculation. That would put the Colonists right in the middle, don't
you see?"
"Yes ... I do," the woman who had once been almost beautiful said.
"Thank you for giving me credit for having that much intelligence.
You seem to forget that I have a fairly good memory too. We've
gone over this a hundred times."
"Sure we have. But it doesn't seem to have made too deep an
impression on you. You can sum it all up by saying that on paper,
from day to day, it's the Colonists who now own the Endicott
Combine, or most of it. So it's the Colonists who are carrying the
battle directly to Wendel, fighting for the right to go on wildcatting,
to get rich overnight or end up pauperized. It's wildcatting in a
sense, just as it was when oil instead of atomic fuel was the big
prize to be fought over Earthside. When a Colonist buys Endicott fuel
cylinders on margin, it's practically the same as if he were digging an
oil well in his own backyard."
"Go on, John," the woman said wearily.
"There's that much uncertainty in it, don't you see? And he's really
doing it entirely single-handed and on his own, because he's digging
in what is practically a paper graveyard in some respects, unless he's
one of the lucky ones. Endicott keeps the fuel. It doesn't go out of
their hands. But Wendel still has to buy it directly from the Colonists,
who are supposed to own it, and the price fluctuations keep Wendel
from becoming all-powerful and Endicott from going under or being
dwarfed.
"In the main, it's the Colonists who have most to gain by keeping
Endicott powerful and solvent ... although the battle lines aren't so
tightly drawn that it doesn't become profitable, at times, to go over
to the Wendel side. There's a lot of sniping between the lines."
"I know all that, John."
"Well, here's what it all boils down to, what you didn't seem to
grasp. You asked me why I brought these six cylinders home. It's
because of the one man who did suspect, right from the first, and
when the charters were drawn up, that a war of this kind might be
waged. I can't even tell you his name. He was probably a minor
legal expert or auditor employed by the Board, who had shrewd
prophetic gifts ... enough foresight, at least ... to insert in fine print
in both of the charters a provision that Wendel is now using to call
Endicott's bluff.
"That provision doesn't say that Endicott can't sell some of their fluid
assets on margin. But it sets a limit to that kind of speculative
buying and selling. The same limit would apply to Wendel, but
Wendel has no fluid assets to sell on margin, and it can't very well
break up its generators and big transmission lines and sell them to
the Colonists piecemeal, even on margin. It wouldn't look right,
because you can't pretend that a fragment of a pipe that is still
being operated by a combine is a speculative commodity that has
passed into other hands and is subject to day-to-day fluctuations.
"If you want to think of fluid assets as simply a share in a Combine's
profits, that's another matter. But I'm not talking about that kind of
fluid asset. Endicott has been selling to the Colonists in a literal
sense—moveable fluid assets. And in fine print in the Endicott
charter it says that Endicott can only sell about a third of its fuel
cylinders on margin. The others have to be purchased outright and
carried home and held by the purchaser until the price is right and
he can dispose of them at a profit. Or sell at a loss, as property."
"But you say you didn't buy those cylinders outright. How could you
have done that?" the woman protested. "Just one cylinder would
cost—a third of a million dollars."
"Naturally I didn't buy them outright. I bought them on margin. But
Wendel can't prove that. Endicott is covering up for me and because
I've brought them home and can slap my hand on the cool metal
and tell Wendel to go to hell if they try to dispute my ownership—
Endicott still has a chance to come out on top. Wendel is calling
Endicott's bluff, sure. But Endicott is countering with another bluff
and they can make it stick. Their auditing department knows just
how to do that. So every Colonist who wants to go on wildcatting
now has to bring a few cylinders home, to make it look as if he'd
bought them outright. Possession puts you nine-tenths on the
winning side in any legal argument. You ought to know that!"
"Ought I? Just suppose I did. Would that stop me from becoming
terrified, when I know exactly what could happen if the metal isn't
as cool as you hope it will be when you slap your hand on it, and the
Wendel police stay cold-blooded about it, and wait around for the
fissionable material inside to reach critical mass."
"You know damn well it would take an awful lot of accidental jarring
and jolting to trigger a fuel cylinder and make it blow up. It probably
couldn't happen, except in a laboratory where they're careless about
such things because of overconfidence."
"Dinner's on the table," the woman said. "We may as well go back
into the house while we've still got a home, and gather the children
around us, and tell them a few more lies about what the future is
going to be like in the Colony, now that one father in three will be
bringing nuclear fuel cylinders home with him."
The man—his name was John Lynton—nodded and they returned
into the pre-fab. Lynton preceded his wife into the dwelling and the
woman paused for an instant in the doorway to stare back at the
long metal shed where the six cylinders were reposing ... letting her
gaze take in as well the double row of foot-high cactus plants which
encircled the yard and the sun-reddened stretch of open desert
beyond. Then she let the door swing shut behind her, and turned to
face her four hungry children.
One thought alone sustained Grace Lynton at that moment. There
had never been any need, so far, for the children to go to bed
hungry. Their hunger was due solely to the demands of healthy
young appetites when dinner was a little delayed and they had been
playing strenuously in the yard all afternoon or going on exploring
expeditions.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like