I need help with this code. It keeps giving me the error "Traceback (most recent call last):   File "main.py", line 29, in     plus()   File "main.py", line 6, in plus     num1 = float(input("Input the first number you'd like to add:")) TypeError: 'str' object is not callable"   It would be great if you could help me.   import math input = input("Enter either Plus, Minus, Multiply, or Divide exactly like listed") def plus():   num1 = float(input("Input the first number you'd like to add:"))   num2 = float(input("Input the second number that you would like to add:"))   num3 = float(input("Input the third number that you would like to add:"))   num4 = float(input("Input the forth number that you would like to add:"))   num5 = float(input("Input the fith number that you would like to add:"))   print(num1 + num2 + num3 + num4 + num5) def minus():   x = float(input("Input the first number you'd like to subtract:"))   y = float(input("Input the second number that you would like to subtract:"))   print(x - y) def divide():   d1 = float(input("Input the first number you'd like to divide:"))   d2 = float(input("Input the second number that you would like to divide:"))   print(x / y)    def multiply():   m1 = float(input("Input the first number you'd like to multiply:"))   m2 = float(input("Input the second number that you would like to multiply:"))   print(m1 * m2) if input == "Plus":   plus() if input == "Minus":   minus()

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I need help with this code. It keeps giving me the error "Traceback (most recent call last):
  File "main.py", line 29, in <module>
    plus()
  File "main.py", line 6, in plus
    num1 = float(input("Input the first number you'd like to add:"))
TypeError: 'str' object is not callable"

 

It would be great if you could help me.

 

import math

input = input("Enter either Plus, Minus, Multiply, or Divide exactly like listed")

def plus():
  num1 = float(input("Input the first number you'd like to add:"))
  num2 = float(input("Input the second number that you would like to add:"))
  num3 = float(input("Input the third number that you would like to add:"))
  num4 = float(input("Input the forth number that you would like to add:"))
  num5 = float(input("Input the fith number that you would like to add:"))
  print(num1 + num2 + num3 + num4 + num5)

def minus():
  x = float(input("Input the first number you'd like to subtract:"))
  y = float(input("Input the second number that you would like to subtract:"))
  print(x - y)

def divide():
  d1 = float(input("Input the first number you'd like to divide:"))
  d2 = float(input("Input the second number that you would like to divide:"))
  print(x / y)
  
def multiply():
  m1 = float(input("Input the first number you'd like to multiply:"))
  m2 = float(input("Input the second number that you would like to multiply:"))
  print(m1 * m2)

if input == "Plus":
  plus()

if input == "Minus":
  minus()

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Files and Directory
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education