Learning Python: The Ultimate Guide for Beginners to Coding with Python with Useful Tools



Download 2,02 Mb.
Pdf ko'rish
bet53/126
Sana01.01.2022
Hajmi2,02 Mb.
#285662
1   ...   49   50   51   52   53   54   55   56   ...   126
Bog'liq
Learning Python The Ultimate Guide for Beginners to Coding with

Exercise to Try
Fruits – Consider at least four of your much-loved fruits. Store these preferred fruit
names in the list of your choice and use a “for loop” to generate each fruit’s name.
Then modify the “for loop” to produce a statement using the fruit name rather than
printing the name of your favorite fruit only. Additionally, for every fruit in the list,
you should generate an output that says, I like apple fruit.
Animals – Think of four animals with common features in life. Store their names in a
list  of  your  choice.  Furthermore,  implement  a  conditional  test  using  “for  loop”  to
display every animal you on your list.
Modify  your  line  of  code  to  produce  a  sentence  about  each  animal.  For
instance, you can say, A lion is the bravest animal I have ever known
Add another line to your program, indicating the unique features of these
animals.  For  instance,  you  can  print  a  general  statement  like;  these
animals are dangerous to human beings.
Note: These programs are very simple to write if you have followed our previous examples above.
Study  them  properly  and  write  your  own  code.  Practice  more,  and  you  will  be  perfect  when  it
comes to writing Python programs.
Numerical Lists
So far, we have been dealing with string as it relates to the list. However, in this section, you will
learn how to perform certain operations on numerical values. In Python, there are many reasons
that may warrant us to store a number. For storing numbers, lists are very important, and Python
provides  various  tools  to  perform  such  action  effectively.  If  you  can  understand  these  tools
effectively, you can work perfectly well even if the list contains thousands of items in it. let us look
at certain operations you can perform on a number as it relates to the list.

Download 2,02 Mb.

Do'stlaringiz bilan baham:
1   ...   49   50   51   52   53   54   55   56   ...   126




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
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