Algorithms For Dummies



Download 7,18 Mb.
Pdf ko'rish
bet164/651
Sana15.07.2021
Hajmi7,18 Mb.
#120357
1   ...   160   161   162   163   164   165   166   167   ...   651
Bog'liq
Algorithms

 

»

Reduce development time



 

»

Reduce programmer error



 

»

Increase application reliability




78

 

   


  PART 1 

 Getting Started

 

»

Allow entire groups to benefit from the work of one programmer



 

»

Make code easier to understand



 

»

Improve application efficiency

In fact, functions do a whole list of things for applications in the form of reus-

ability. As you work through the examples in this book, you see how reusability 

makes your life significantly easier. If not for reusability, you’d still be program-

ming by plugging 0s and 1s into the computer by hand.

Creating a function doesn’t require much work. To see how functions work, open 

a copy of IPython and type in the following code (pressing Enter at the end of  

each line):

def SayHello():

    print('Hello There!')

To end the function, you press Enter a second time after the last line. A function 

begins with the keyword 

def


 (for define). You provide a function name, parenthe-

ses that can contain function arguments (data used in the function), and a colon. 

The editor automatically indents the next line for you. Python relies on whitespace 

to  define  code blocks (statements that are associated with each other in a 

function).

You can now use the function. Simply type SayHello() and press Enter. The paren-

theses after the function name are important because they tell Python to execute 

the function rather than tell you that you are accessing a function as an object (to 

determine what it is). You see 

Hello There!

 as the output.


Download 7,18 Mb.

Do'stlaringiz bilan baham:
1   ...   160   161   162   163   164   165   166   167   ...   651




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2025
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish