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



Download 2,61 Mb.
bet55/200
Sana20.06.2022
Hajmi2,61 Mb.
#681748
1   ...   51   52   53   54   55   56   57   58   ...   200
Bog'liq
Python Projects for Beginners A Ten Week Bootcamp Approach to Python

Weekly Summary
What a week! We’ve just seen how we can interact with our user and be able to perform branching statements. This will allow us to build projects with logic, which will perform specific code based on information that the program is using. The biggest concepts to remember here are our conditional statements and try/except blocks. It’s important to know the difference between catching an error and an error causing your program to crash. We always want to catch errors when possible to sure up our program. Next week we’ll learn about loops and how we can continuously run blocks of code over and over until we no longer want to.
Challenge Question Solution
If you were to run the code block for the challenge question, you would find that it produces an error. This is because we try to access our “element” variable before it’s declared. If you were to reverse these two lines, the program would work as desired.
Weekly Challenges
To test out your skills, try these challenges:

  1. Reversing Numbers: Alter the calculator project so that the order of the numbers doesn’t matter. There are a few ways to get the same result; one way is to ask the user if they’d like to reverse the placement of the numbers.

  2. Age Group: Ask the user to input their age. Depending on their input, output one of the following groups:

    1. Between 0 and 12 = “Kid”

    2. Between 13 and 19 = “Teenager”

    3. Between 20 and 30 = “Young Adult”

    4. Between 31 and 64 = “Adult”

    5. 65 or above = “Senior”

  3. Text-Based RPG: This is an open-ended exercise. Create a textbased RPG with a story line. You take user input and give them a couple choices, and depending on what they choose, they can go down a different path. You’ll use several branching statements depending on the length of the story.

CHAPTER 4

Download 2,61 Mb.

Do'stlaringiz bilan baham:
1   ...   51   52   53   54   55   56   57   58   ...   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