Python Projects for Beginners a ten-Week Bootcamp Approach to Python Programming



Download 2,61 Mb.
bet77/200
Sana20.06.2022
Hajmi2,61 Mb.
#681748
1   ...   73   74   75   76   77   78   79   80   ...   200
Bog'liq
Python Projects for Beginners A Ten Week Bootcamp Approach to Python

Challenge Question Solution
Even though there is a specific answer we’re looking for, this was a bit of a trick question.
If your first action was turning around and asking, “what is the problem?” or “why am I evacuating the city?”, then you answered correctly. The reason we need to ask this question first is because different problems require different solutions. If you began writing an evacuation plan that required using cars, what if the problem was that all the streets were flooded. It wouldn’t be very wise to advise people to drive out of the city. Sometimes the answer to a question is a question itself. One other lesson to take away from this is that you should always take a step back and think through each problem.
Never assume you know the solution right away; it’s okay to ask questions.
ChApter 4 LIsts And Loops
Weekly Challenges
To test out your skills, try these challenges:

  1. Pyramids: Use a for loop to build a pyramid of x’s. It should be modular so that if you loop to 5 or 50, it still creates evenly spaced rows. Hint: Multiply the string “x” by the row. For example, if you loop to the range of 4, it should produce the following result:

>>> x
>>> x x
>>> x x x

  1. Output Names: Write a loop that will iterate over a list of items and only output items which have letters inside of a string. Take the following list, for example, only “John” and “Amanda” should be output:

>>> names = ['John', ' ', 'Amanda', 5]

  1. Convert Celsius: Given a list of temperatures that are in Celsius, write a loop that iterates over the list and outputs the temperature converted into Fahrenheit. Hint: The conversion is “F = (9/5) ∗ C + 32”:

>>> temps = [32, 12, 44, 29]
Output would be [89.6, 53.6, 111.2, 84.2]

Download 2,61 Mb.

Do'stlaringiz bilan baham:
1   ...   73   74   75   76   77   78   79   80   ...   200




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