Ask Question
1 October, 08:14

Given the variables full_admission_price and discount_amount (already defined), write an expression corresponding to the price of a discount admission.

You are given two variables, both already defined, one associated with a float and named total_weight, containing the weight of a shipment, the other associated with an int and named quantity, containing the number of items in the shipment. Write an expression that calculates the weight of one item.

Write a for loop that prints all the even integers from 80 through 20 inclusive, separated by spaces.

Use Python

+3
Answers (1)
  1. 1 October, 11:13
    0
    if full_admission_price = f and discount_amount = d

    => Price of a discount admission = d/f

    total_weight

    quantity

    weight of one item = total_weight/quantity

    for i in range (80, 18, - 2):

    print (i, end=' ')

    Explanation:

    The first two questions are just mathematical to get a single quantity given some relationship. So, its basically division

    For the python code, I used the python's range function which takes in three arguments. The first one is the starting value, the second one is the terminating value which is the number before the terminating value and the last one specifies the common difference popularly known as step in the language. Since the step is 2, only even numbers are printed out. In the print function, I made use of the end keyword specifying a space (' ') as the end. This ensures that the print is done in the same line with a space seperating them. Without that specification, each result will printed in a newline
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Given the variables full_admission_price and discount_amount (already defined), write an expression corresponding to the price of a ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers