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



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

THURSDAY EXERCISES


  1. Fix the Errors: Given the following code, fix any/all errors so that it outputs “Hello John” correctly:

>>> name = "John" >>> if name == "Jack":
>>> print("Hello Jack") >>> elif:
>>>> print("Hello John")

  1. User Input: Ask the user to input the time of day in military time without a colon (1100 = 11:00 AM). Write a conditional statement so that it outputs the following:

    1. Good Morning” if less than 1200

    2. Good Afternoon” if between 1200 and 1700

    3. Good Evening” if equal or above 1700


Today we learned all about else statements. You’re now able to build programs that can generate code given a condition.
Friday: Creating a Calculator
Last week we built a receipt printing program together. With the lessons learned from this week, we’re going to be building a simple calculator that accepts user input and outputs the proper result.
To follow along with this lesson, let’s continue from our previous notebook file “Week_03” and add a markdown cell at the bottom that says, “Friday Project: Creating a Calculator.

Final Design


For each week we always want to lay out the final design. As this week is based around the logic rather than how it looks, we’ll lay out the steps necessary to build our calculator:

  1. Ask the user for the calculation they would like to perform.

  2. Ask the user for the numbers they would like to run the operation

on.

  1. Set up try/except clause for mathematical operation.

    1. Convert numbers input to floats.

    2. Perform operation and print result.

    3. If an exception is hit, print error.

Download 2,61 Mb.

Do'stlaringiz bilan baham:
1   ...   48   49   50   51   52   53   54   55   ...   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