1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
olganol [36]
3 years ago
8

Write a script which: Uses the input function to get any number and store it in a variable named my_number Create a new variable

named calculation which equals my_number plus 9 Multiply calculation by 2 Subtract 4 from calculation Divide calculation by 2 Subtract my_number from calculation Print calculation
Computers and Technology
1 answer:
WINSTONCH [101]3 years ago
7 0
<h3><u>Answer:</u></h3>

# Using the input function

# Prompt the user to input some number

# Convert the input to a float - this will cater for both floating

# numbers and integers

# Store the result in a variable called my_number

my_number = float(input('Please enter some number '))

#Create a variable named calculation which equals my_number plus 9

calculation = my_number + 9

#Multiply calculation by 2

calculation *= 2

#Subtract 4 from calculation

calculation -= 4

#Divide calculation by 2

calculation /= 2

#Subtract my_number from calculation

calculation -= my_number

#Print calculation

print('calculation = ' + str(calculation))

<h2><u>Sample Output</u></h2>

>> Please enter some number 8

calculation = 7.0

<h2><u>Explanation:</u></h2>

The above program has been written in Python and it contains comments explaining each line of the code. Please go through the comments. A sample output has also been provided.

You might be interested in
What is the first step to apply the line and page breaks options to groups of paragraphs in a Word document?
bezimeni [28]

Answer:

accessing the Paragraph dialog box

Explanation:

8 0
3 years ago
Read 2 more answers
Pedestrians have ______.
Ne4ueva [31]

Answer:

c

Explanation:

I think c is correct answer if I answer wrong

3 0
3 years ago
A ______ is a device that provides a connection between two lans that use the same protocol, or it can separate them into two se
zaharov [31]

I guess the answer in the blank is Bridge.

A bridge is a device that provides a connection between two LANs that use the same protocol, or it can separate them into two sections.

7 0
3 years ago
A technician assists Joe, an employee in the sales department who needs access to the client database, by granting him
bija089 [108]

Answer:

Principle of least privilege

Explanation:

The principle of least privilege means the user has only access to that data which is required to complete the task

Therefore as per the given situation, Joe who is an emloyee wants to access the client data base but later on he needs to access the payroll data base

So as per the given situation, the first option should be violated

Hence, the same is to be considered

5 0
2 years ago
Which of the following illustrates an example of a string data type?
Inga [223]
"true" is a string type of data. String types of data are lines of text between quotation marks. They are generally used for displaying text to users but can be helpful for debugging as well.
6 0
3 years ago
Other questions:
  • Variable names may contain spaces and punctuation symbols. True False
    15·1 answer
  • Is a collection of limited versions of Microsoft office programs
    10·1 answer
  • What are the most popular/up-and-coming social media applications?
    10·2 answers
  • In excel, an anchor($) allows you to?
    10·1 answer
  • Moore’s law refers to?
    5·1 answer
  • Which of the following is true about STEM education? STEM education is focused on understanding rather than applying scientific
    15·1 answer
  • When calling a function with arguments that should be modified, the __________ of those arguments are passed.
    5·1 answer
  • People can use social media responsibly by what​
    14·2 answers
  • The EDI ____________layer describes the business application that i
    9·1 answer
  • Can development and conservation of environment go hand-in-hand? Explain your point of view
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!