def add(x, y): \n   return x + y \n\ndef subtract(x, y): \n   return x - y \n\ndef multiply(x, y): \n   return x * y \n\ndef divide(x, y): \n   return x / y \n\nnum1 = float(input("Enter first number: ")) \nnum2 = float(input("Enter second number: ")) \n\nprint("Select operation.") \nprint("1.Add") \nprint("2.Subtract") \nprint("3.Multiply") \nprint("4.Divide") \n\nchoice = input("Enter choice(1/2/3/4):") \n\nif choice == \1\: \n   print(num1,"+",num2,"=", add(num1,num2)) \n  \nelif choice == \2\: \n   print(num1,"-",num2,"=", subtract(num1,num2)) \n   \nelif choice == \3\: \n   print(num1,"*",num2,"=", multiply(num1,num2)) \n\nelif choice == \4\: \n   print(num1,"/",num2,"=", divide(num1,num2)) \nelse: \n   print("Invalid input")
Write a few lines of code to create a basic calculator in Python.?