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:
The Python programming language is a great tool to use when working with numbers and evaluating mathematical expressions. This quality can be utilized to make useful programs.
This tutorial presents a learning exercise to help you make a simple command-line calculator program in Python 3. While we’ll go through one possibile way to make this program, there are many opportunities to improve the code and create a more robust calculator.
We’ll be using math operators, variables, conditional statements, functions, and handle user input to make our calculator.
Prerequisites
For this tutorial, you should have Python 3 installed on your local computer and have a programming environment set up on the machine. If you need to either install Python or set up the environment, you can do so by following the appropriate guide for your operating system.
Step 1 — Prompt users for input
Calculators work best when a human provides equations for the computer to solve. We’ll start writing our program at the point where the human enters the numbers that they would like the computer to work with.
To do this, we’ll use Python’s built-in input() function that accepts user-generated input from the keyboard. Inside of the parentheses of the input() function we can pass a string to prompt the user. We’ll assign the user’s input to a variable.
For this program, we would like the user to input two numbers, so let’s have the program prompt for two numbers. When asking for input, we should include a space at the end of our string so that there is a space between the user’s input and the prompting string.
number_1 = input('Enter your first number: ')
number_2 = input('Enter your second number: ')
After writing our two lines, we should save the program before we run it. We can call this program calculator.py and in a terminal window, we can run the program in our programming environment by using the command python calculator.py. You should be able to type into the terminal window in response to each prompt.
Output
Enter your first number: 5
Enter your second number: 7
If you run this program a few times and vary your input, you’ll notice that you can enter whatever you want when prompted, including words, symbols, whitespace, or just the enter key. This is because input() takes data in as strings and doesn’t know that we are looking for a number.
Explanation:
Hope This helps with your coding
( If it doesn't then sorry)
You have a database with three tables: one each for products, suppliers, and distributors. You need to locate the product ID number for hammers and find out who supplies them. Which database component would perform this task?
A. Form
B. Table
C. Report
D. Query
Answer:
I would say A... But that's just me
Explanation:
Hopefully this helps you :))
Answer:
The answer is C: Query
Explanation: I just did it in Edge 2021. Trust me its right! I hope this helps! :)
Can someone please help me with this assignment on Edhesive. I just need the storyboard and code. thank you.
Answer:
i need points im so sorry
Explanation:
Write a program code to accept the names of 3 users and generate a user name as shown in the example. Accept the name of 3 user in the format – Firstname Last name (eg. Anan Gupta). Select the first 3 characters from the first name, add # and then add last 3 characters of the last name. Display the newly generated user name along with the names that were input.
Answer:
Explanation:
The following code is written in Python and is a function that loops three times asking for the last name and first name. Then it uses this information to create a username. Finally, each of the names and usernames is printed on the screen.
def userName():
for x in range(3):
last_name = input("What is your last name: ")
first_name = input("What is your first name: ")
username = first_name[:3] + "#" + last_name[-3:]
print(last_name + ", " + first_name)
print(username)
Read the code snippet below and determine which markup language it is:
Sound Card
Creative Labs
Sound Blaster Live
80.00
The code is an example of the (Blank) markup language.
Answer:
Sound Card
Explanation:
Choose the best option to answer each question on design or development.
Answer:
design
requirements
code
(in that order)
Explanation:
it was right on edge
if you hard working right now go to this EASY question
#BRAINLY and I will give you brainlist something I forgot what's it called for your hard work
A website is unencrypted. Which tool can be used to stop the website’s traffic and analyze the information on it?
Answer:
Explanation:
Web analytics is the computation, amassing, study and reporting of web data for purposes of accepting and adjust web custom. although, Web analytics is not just a method for measuring web traffic but can be used as a tool for job and market study, and to determine and become better the effectiveness of a website. Web analytics applications can also help companies measure the broadcast advertising attacks. Web analytics support information about the number of users to a website and the number of page views. It helps measure traffic and popularity trends which is useful for market study.
Which of the following is NOT an acceptable way to create a color?
A) O "cyan"
B) O "#ff2341"
C) blue
D) "RGB (0, 15, 234)"
The option that is not an acceptable way to create a color is blue.
How can I create a color?There are a lot of ways to create some unique color such as the additions of colors together. An example is the addition of purple, orange, and green together.
Note that blue on its own cannot create another color and as such, The option that is not an acceptable way to create a color is blue.
Learn more about color from
https://brainly.com/question/4431200
#SPJ2
Choose all items that are true about the two example of HTML shown on the right.
A. Example 1 will display differently than example 2 in a web browser.
B. They are styled differently, but will look the same in a web browser.
C. Example 2 is easier to analyze and repair.
D. The styling in example 2 is required by modern web browsers.
Answer:
“They are styled differently, but will look the same in a web browser” & “The styling in example 2 is required by modern web browsers”.
Explanation:
Answer:
B and C
Explanation:
PLEASE ANSWER ASAP!!!
Name the error that can happen as a result of adding binary numbers.
Answer:
Sometimes, when adding two binary numbers we can end up with an extra digit that doesn't fit. This is called an overflow error. This sum is fine as the original numbers have two digits, and the result of the sum also has two digits.
Explanation:
Write a program to convert centigrade to Kelvin. It should display value in centigrade and then the value in Kelvin just as you displayed squares in the previous question. The range to be followed for this conversion is from 50-100 degree celsius.
So, it should look like this:
1. Centrigrade: 50 --> Kelvin: 323.15
2. Centrigrade: 51 --> Kelvin: 324.15
3. Centrigrade: 52 --> Kelvin: 325.15
etc.
Answer:
for degree in range(50, 101):
kelvin = degree + 273.15
print("Centrigrade: {} --> Kelvin: {}".format(degree, kelvin))
Explanation:
*The code is in Python.
Create a for loop that iterates from 50 to 100 (Note that the starting value is included, but the ending value is not included in the range method. That is why you need to write range(50, 101) to iterate from 50 to 100)
Convert the centigrade to kelvin using formula (Note that the degree variable represents the each centigrade degree from 50 to 100 and you need to add 273.15 to convert it to Kelvin)
Print the result as in requested format
If Tamya makes $1000.00 gross monthly income and her total payroll deductions are $294.00, what is her net income?
Answer:
$751
Explanation:
From the question we have the following information;
Gross income = $1000.00
Deductions = $294.00
Now we know that;
Net income = Gross income - Deductions
Therefore;
Net income = $1000.00 - $294.00
Net income = $751
What happens if an email server cannot find a matching username or the mailbox is full
Answer:
if the email server cannot find a matching username, you need to verify your email. I think at least.
Explanation:
Answer:
it do not send your e-mail
Search and read all phenomenon listed below and identify the ICT platform they used.
PHENOMENON
1. EDSA and Cardinal Sin
2. EDSA dos
3. Million people march against Pork Barrel
4. Disaster relief operations and mobilization
Answer:
1. Radio broadcast
2. Text brigades
3. Social media and change website
4. Internet and text brigades
Explanation:
I'm having issues posting my answer. Please go through the attachment.
Answer:
1. Radio broadcast
2. Text brigade
3. Social media and change website
4. Internet and text brigades
Explanation:
ICT can serve as a medium through which change can be effected in a society.
1 EDSA and cardinal
The ICT used here was the radio.
2. EDSA dos
The ICT that was used her was the text brigades.
3. Million people march
The ICT used here was social media and the change website.
4. ICT used here is internet and text messaging.
Please I have provided background information to what caused these events. I typed my answers but the editor did not allow me post it.
Thank you.
Someone please tell me what lambda does! in python!! I need help
Answer:Lambda Technologies is the he is the group name encompassing a Premier materials research laboratory with an engineering and production enterprise dedicated to the development and optimization of of surface treatments our company has been selling materials for over four decades with over 150 years of combined experience in more than 20,000 research programs we are proud of our corporate legacy in record or around standing performance in meeting or customers needs room training all excellence groundbreaking innovation and committed hard-working employees we are able to provide more than just data we provide complete service enhancement solutions are resources that can include all of our technical papers he studies defraction notes and downloads we are a well known source of research in education materials on the understanding measurement and controls of residual stress
Explanation:
True or false: Machine learning lets computers
learn how to do things they weren't
specifically programmed to do.
Answer:
True
Explanation:
ayo which one is better genshin impact or fortnite, i personally prefer genshin impact since it's not boring and it has so many other things you could do when you're not doing a story quest or daily commissions
Answer:
Genshin Impact and you can fight me on it.
Explanation:
The game has way more to explore and offer with different fighting styles which include Magic and Swords fighting. It also has more story and I appreciate that!
The side quests to get tedious though so the final rating is 8.79//10.00
Answer:
genshin
Explanation:
In many supermarkets customers can pay for their shopping using credit cards. (a) Name two items of information stored on the magnetic stripe on these cards. (b) State two ways that the supermarket computer would check the credit card.
Answer:
Explanation:
Two items on the magnetic strip are, Credit Card info and Balance
Two ways supermarket may check are the PIN pad you are using to pay or their reciept system.
Can someone tell me 5 facts about Registers and RAM, please?
[tex]\int\limits^a_b {x} \, dx \left \{ {{y=2} \atop {x=2}} \right. \lim_{n \to \infty} a_n \neq \neq \geq[/tex]Answer:
A register is a temporary storage area built into a CPU. ... The instruction register fetches instructions from the program counter (PC) and holds each instruction as it is executed by the processor. The memory registers are used to pass data from memory to the processor.
PLS MARK BRAINLIEST!!!
PLEASE
:
I really need help with this question, I can’t fail this please :) tysm
Answer:
i think its the third one, i hope this helps
Explanation:
Type the correct answer in the box. Spell all words correctly.
Ben has to type a long letter to his friend. What is the correct keying technique that Ben should use?
To prevent strain and key correctly, Ben should
his fingers gently over the keys with his wrist in a flat position.
Explanation:
Type the correct answer in the box. Spell all words correctly.
Ben has to type a long letter to his friend. What is the correct keying technique that Ben should use?
To prevent strain and key correctly, Ben should use his fingers gently over the keys with his wrist in a flat position.
how many people in the world
Answer:
Around seven billion people
Boolean Operators help filter information when completing a ________ ________
A. web search
B. column making
definition of data redundancy
Answer:
Data redundancy occurs when the same piece of data exists in multiple places, whereas data inconsistency is when the same data exists in different formats in multiple tables. Unfortunately, data redundancy can cause data inconsistency, which can provide a company with unreliable and/or meaningless information
what is the importance of knowing and following a step /steps of the personal computer disassembly
Answer:
emergency pils at a doctor
Help me get this
Also use these commands
1 Sales tax
5.00%
Use the image to help you answer the question.
Which formula will tell you the total "Before tax"
price using cell references?
A. =3+2+50
B. =B8
C. =B4+B5+B6
D. =B4*B5*B6
Answer:
Future value (FV) tells you the value in the future of money deposited in a bank account ... We can use Excel to make a table of how the future value grows with the ... 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. A. B. C. D. E. F. Interest. 6% ... To answer the question, we compute the IRR of the investment and compare it.
Explanation:
Answer:
C. = B4+B5+B6
Explanation:
Edge 2020
Why is it a good practice to use functions in programming? Select the best answer.
A.It is faster to run the code using functions.
B.Functions allow us to reuse common code.
C.All of these are correct.
D.It is easier to debug the code using functions.
Answer:
C. All of these are correct answer from the options for the question that u have given...
The good practice to use functions in programming is all of these are correct. The correct option is C.
What are functions in programming?The repetitious codes are removed by breaking a program down into functions, which not only reduces the size of the program but also improves its effectiveness. If there were repetitive codes, we would need to alter the program from several locations rather than just one.
As a result, organizing programs into functions aid in good administration and shortens programs by removing repeated code. A functional programming language is a particular kind of language that allows for the creation and application of pure mathematical functions, along with the use of conditional expressions and recursion to carry out various computations.
Therefore, the correct option is C. All of these are correct.
To learn more about functions in programming, refer to the link:
https://brainly.com/question/24297344
#SPJ6
True or False? Security code is almost always open source!
True
False
Answer:
its true
Step-by-step explanation:
Security code is almost always open source is a false statement. Check more about Security code below.
What is security code?The Security code is known to be the number that is known to be found in the front or back of any credit cards. It is made just for security use.
Conclusively, Security code is almost always open source as one cannot get it except one is told about it. Therefore, it is not an open source.
Learn more about Security code from
https://brainly.com/question/26260220