So to start coding I decided to create a simple calculator which takes the input from the user, turns it into two separate lists, then asks which operations you want to use, and does the equation. The problem is though is that I will say I want to use subtraction, for example, my two numbers are 10 and 5, then the output is 15. Here is my code:
first_numbers = []
second_number = []
maxLengthList = 1
while len(first_numbers) < maxLengthList:
item = input("Enter Your First Number To Be Calculated: ")
first_numbers.append(item)
while len(second_number) < maxLengthList:
item = input("Enter Your Second Number To Be Calculated: ")
second_number.append(item)
type_of_computing = raw_input('(A)dding or (S)ubtracting or (M)ultiplying or (Dividing): ')
if type_of_computing == 'A' or 'a':
print ('Final Result:')
sum_list = [a + b for a, b in zip(first_numbers, second_number)]
print sum_list
elif type_of_computing == 'S' or 's':
print ('Final Result:')
difference_list = [c - d for c, d in zip(first_numbers, second_number)]
print difference_list
elif type_of_computing == 'M' or 'm':
print ('Final Result:')
product_list = [e * f for e, f in zip(first_numbers, second_number)]
print product_list
elif type_of_computing == 'D' or 'd':
print ('Final Result:')
quotient_list = [g / h for g, h in zip(first_numbers, second_number)]
print quotient_list