# -------------------------------------------------------------------------------------------------
# Exercise_01
# Write a Python program which accepts the radius of a circle from the user and compute the area
 # -------------------------------------------------------------------------------------------------

from math import pi

print('Exercise_01')

radius = float(input ('Input the radius of the circle: '))
area = (pi * radius**2)
print('The area of the circle with radius ' + str(radius) + ' is ' + str(area) + '\n\n')

# -------------------------------------------------------------------------------------------------
# Exercise_02
# Write a Python program to calculate number of days between two dates
# -------------------------------------------------------------------------------------------------

from datetime import date

print('Exercise_02')

yy = int(input('Input the start date year: '))
mm = int(input('Input the start date month: '))
dd = int(input('Input the start date day: '))
start_date = date(yy,mm,dd)

yy = int(input('Input the finish date year: '))
mm = int(input('Input the finish date month: '))
dd = int(input('Input the finish date day: '))
finish_date = date(yy,mm,dd)

diff = (finish_date - start_date)

print('Number of days between ' + str(start_date) + ' and ' + str(finish_date) + ' is ' + str(diff))

# -------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------
while True:
    choice = int(input('Please enter the number of exercise: '))

# -------------------------------------------------------------------------------------------------
# Exercise_01
# Write a Python program which accepts the radius of a circle from the user and compute the area
# -------------------------------------------------------------------------------------------------

    if(choice == 1):

        from math import pi

        print('\nExercise_01')

        radius = float(input ('Input the radius of the circle: '))
        area = (pi * radius**2)
        print('The area of the circle with radius ' + str(radius) + ' is ' + str(area) + '\n\n')

# -------------------------------------------------------------------------------------------------
# Exercise_02
# Write a Python program to calculate number of days between two dates
# -------------------------------------------------------------------------------------------------

    elif(choice == 2):

        from datetime import date

        print('\nExercise_02')

        yy = int(input('Input the start date year: '))
        mm = int(input('Input the start date month: '))
        dd = int(input('Input the start date day: '))
        start_date = date(yy,mm,dd)

        yy = int(input('Input the finish date year: '))
        mm = int(input('Input the finish date month: '))
        dd = int(input('Input the finish date day: '))
        finish_date = date(yy,mm,dd)

        diff = (finish_date - start_date)

        print('Number of days between ' + str(start_date) + ' and ' + str(finish_date) + ' is ' + str(diff) + '\n')

# -------------------------------------------------------------------------------------------------
# Exercise_03
# Write a Python program to compute the greatest common divisor (GCD)  and the least common multiple (LCM)
# of two positive integers.
# -------------------------------------------------------------------------------------------------

    elif(choice == 3):
    
        def gcd(x, y):
            while y != 0:
                (x, y) = (y, x % y)
            return abs(x)

        def lcm(x,y):
            return ((x * y)/ gcd(x,y))

        print('\nExercise_03')

        firstNumber = int(input('Please enter first number: '))
        secondNumber = int(input('Please enter second number: '))

        print('GCD between ' + str(firstNumber) + ' and ' + str(secondNumber) + ' is ' + str(gcd(firstNumber,secondNumber)))
        print('LCM between ' + str(firstNumber) + ' and ' + str(secondNumber) + ' is ' + str(lcm(firstNumber,secondNumber)) + '\n')

# -------------------------------------------------------------------------------------------------
# Exercise_04
# 
# -------------------------------------------------------------------------------------------------

    elif(choice == 4):       

        print('\nExercise_04')    

# -------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------

    else:
        print('Make a choice')
Add new exercise to Math.py