In python/Spyder
A. We can define the sum from 1 to x (i.e. 1 + 2 + ... + x) recursively as follows for integer x ≥ 1:
1, if x = 1
x + sum from 1 to x-1 if x > 1
Complete the following Python program to compute the sum 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 recursively:
def main():
# compute and print 1 + 2 + ... + 10
print (sum(10) )
def sum(x):
# you complete this function recursively
main()
}B. Simple ATM simulation – write an application that displays a menu of options and process accordingly based on user selection. Implement a function for each option selected. Add exception handling where appropriate.