💡 For the best experience, set your browser zoom level to 75%

    ‎75%‎ للحصول على أفضل تجربة، اضبط مستوى تكبير المتصفح على 💡

Skip to main content

Lesson 12 - Assignment

Write a Python script that:

1.    Creates a global variable x = 50. Inside a function, change its value to 100 using the global keyword and print both values (before and after).

2.    Creates a datetime object for your birthday and prints it using strftime() in the format: Day Month, Year (e.g., 24 May, 1998).

3.    Uses the math module to:

o   Calculate and print the square root of a number.

o   Round a floating number to the nearest integer.

o   Find the value of sin(90°) using radians.