Local and global variables, the GCD (EKUB) function
Answers are for parents and teachers.
1
What does this program print? (A global variable is read.) x = 10 ⏎ def f(): ⏎ print(x) ⏎ f()
10
2
Find the EKUB(56, 42).
14
3
Reduce the fraction 12/30: write the numerator and denominator.
2 and 5
4
a and b are typed. Write a program that prints the EKUK (12 for 4 and 6).
def ekub(a, b): ⏎ while b != 0: ⏎ a, b = b, a % b ⏎ return a ⏎ x = int(input()) ⏎ y = int(input()) ⏎ print(x * y // ekub(x, y))