Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.1 KB

File metadata and controls

56 lines (40 loc) · 1.1 KB

Exercises

Create these files inside your own folder: submissions/<your-github-username>/.

exercise_1.py — About me

Print a sentence about yourself using an f-string with your name, age, and city.

Example output:

My name is Ada, I am 25 years old, and I live in Tbilisi.

exercise_2.py — Fix the bug

This code raises a TypeError. Copy it into exercise_2.py, then fix it using type casting so it runs without error and prints I am 25 years old.

age = 25
print("I am " + age + " years old")  # BUG: fix this line

exercise_3.py — Rectangle

Given width = 4 and height = 7, print the area and perimeter.

Expected output:

Area: 28
Perimeter: 22

exercise_4.py — Odd or even

Given number = 17, use % to determine if it's even, and print the result as a bool.

Expected output:

17 is even: False

exercise_5.py — Bonus: seconds in a day and a week

Print how many seconds are in a day and in a week, computed from 60 * 60 * 24 (don't hardcode the final numbers).

Expected output:

Seconds in a day: 86400
Seconds in a week: 604800