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]
4 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]4 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
The max-age attribute of a cookie is specified in
defon

Answer:

seconds.

Explanation:

max-age attribute of a cookie is specified in seconds.It sets the time when the cookie will be deleted.max-age attribute is not supported by all the browser.Internet Explorer does not support max-age.Son expires is used more than max-age because it supports almost all the browsers.

6 0
3 years ago
1. Write a SELECT statement that returns these columns: The count of the number of orders in the Orders table The sum of the Tax
Arada [10]

Answer:

SELECT

COUNT(SN), SUM(TaxAmount)

FROM ORDERS  

or

SELECT

COUNT(SN) AS NumOrder, SUM(TaxAmount) As TotalTax

FROM ORDERS

Explanation:

Finding it difficult to add my explanation. So, I used an attachment instead

<em />

Download docx
8 0
3 years ago
1.Write a program in python to find the sum and average of any 3 input numbers.
klasskru [66]

Answer:

ok then i might if i can be bothered

P(-2,2), Q(4,2), R(2, -6), S(-4,-6P(-2,2), Q(4,2), R(2, -6), S(-4,-6P(-2,2), Q(4,2), R(2, -6), S(-4,-6

4 0
3 years ago
Which lines of the code, marked by Q, are legally declared based on the scope of the variable?​
WINSTONCH [101]

inside a function or a block which is called local variables

4 0
2 years ago
You are part of which sphere of Earth?
Elden [556K]
We are on the lithosphere
4 0
3 years ago
Read 2 more answers
Other questions:
  • This device transmits data to all the workstations on a network. gateway hub router switch
    11·2 answers
  • Which of the following statements is/are true by definition.
    5·1 answer
  • A network administrator was testing an IPS device by releasing multiple packets into the network. The administrator examined the
    13·2 answers
  • What is the clearing house for domain names called?
    12·1 answer
  • Write a function:
    13·1 answer
  • I am a mouse, but im not a mouse.<br><br> What am I?
    12·1 answer
  • Think about that the C, B and S parameters of a Cache. Think about what happens to compulsory, capacity, conflict misses, if onl
    7·1 answer
  • Write convert() method to cast double to int Complete the convert() method that casts the parameter from a double to an integer
    12·1 answer
  • Today's consoles and games have audio features that rival cinematic audio.<br> True or False?
    6·2 answers
  • If one of the resistors is turned off (I.e. , a light bulb goes out), what happens to the other resistors (light bulbs) in the c
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!