![Computers and Technology](/tpl/images/cats/informatica.png)
Computers and Technology, 09.02.2021 19:10, maggie123456751
Part B
There are many different ways that a user could tell us that he or she would like to add two numbers in our calculator program. The user could type “add”, “Add”, “ADD”, or “+”, to name a few possibilities. Of course, as humans, we know exactly what is meant, even if the word is capitalized. But the Python Interpreter can’t tell that “add” is the same as “Add”.
We can use a list to make our program a bit more robust. We can also use the IN operator to check for certain values in that list. Take a look at this if statement’s opening line:
if operation in [“add”, “Add”, “ADD”, “+”]:
Make those changes in your program and verify that it works.
Consider all of the possible words the user might enter to subtract, multiply, or divide.
Rewrite the first lines of each of your if statements to use lists.
Thoroughly test your new program, trying out each of the four operations.
Share the link to your Python code in REPL. it with your teacher by clicking on the share button and copying the link.
![answer](/tpl/images/cats/otvet.png)
Answers: 1
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 22:30, hmontalvo22
Who needs to approve a change before it is initiated? (select two.) -change board -client or end user -ceo -personnel manager -project manager
Answers: 1
Do you know the correct answer?
Part B
There are many different ways that a user could tell us that he or she would like to add two...
Questions in other subjects:
![Konu](/tpl/images/cats/en.png)
English, 18.07.2019 01:40
![Konu](/tpl/images/cats/en.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 18.07.2019 01:40
![Konu](/tpl/images/cats/istoriya.png)
History, 18.07.2019 01:40
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/en.png)
![Konu](/tpl/images/cats/fizika.png)
![Konu](/tpl/images/cats/User.png)
![Konu](/tpl/images/cats/fizika.png)