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
Alex
2 years ago
8

Use input() function to take 4 user inputs as variables and choose at least 2 ways to print out the following statements. You ca

nnot print the statement literally.
Computers and Technology
1 answer:
taurus [48]2 years ago
6 0

Answer:

statements = tuple(input("Enter four statements separated by comma: ").split(","))

st1, st2, st3, st4 = statements

#print with:

print(f"{st1}, {st2}, {st3}, {st4}")

# or:

print("{}, {}, {}, {}".format(st1, st2, st3, st4))

Explanation:

The input function in python is used to prompt for user input. It returns a string. The code above splits the string of the input function and converts it to a tuple, which is unpacked in four variables st1, st2, st3, and st4.

The variables can be printed out as strings directly or by using the "f" keyword or the format function.

You might be interested in
How do you take a screen shot on hp pavilion dm3
drek231 [11]
Press and hold down the "Fn" button while pressing the "Home Prt Sc" button above the numeric keypad to capture the entire screen. Make a screenshot of the active window only by holding down the "Fn" and Alt" keys while pressing "Home Prt Sc." 2. Press the "Start" button, and type "Paint" into the search box.
5 0
3 years ago
Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
sdas [7]

Answer:

The modified program in Python is as follows:

import math

paint_colors = {'red': 35,'blue': 25,'green': 23}

wall_height = int(input('Enter wall height (feet):\n'))

wall_width = int(input('Enter wall width (feet):\n'))

area = wall_height*wall_width

print('Wall area:',area,'square feet')

paint_needed = area/350.0

print('Paint needed: {:.2f} gallons'.format(paint_needed))

print('Cans needed:',round(paint_needed),'can(s)')

color = input("Choose a color to paint the wall: ")

print("Cost of purchasing", color, "paint: $",paint_colors[color])

Explanation:

The italicized are given from the question [unchanged]

<em>import math</em>

<em> paint_colors = {'red': 35,'blue': 25,'green': 23} </em>

<em>wall_height = int(input('Enter wall height (feet):\n')) </em>

This gets input for width

wall_width = int(input('Enter wall width (feet):\n'))

Calculate the wall area

area = wall_height*wall_width

Print the calculated wall area

print('Wall area:',area,'square feet')

Calculate the amount of paint needed

paint_needed = area/350.0

Print the amount of paint needed to 2 decimal places

print('Paint needed: {:.2f} gallons'.format(paint_needed))

Print the amount of can needed to nearest integer

print('Cans needed:',round(paint_needed),'can(s)')

Prompt user for color of paint [here, we assume the user input is correct]

color = input("Choose a color to paint the wall: ")

Prints the corresponding amount for the color

print("Cost of purchasing", color, "paint: $",paint_colors[color])

3 0
2 years ago
How do u answer questions on brainly if ur on the app and on a phone. For me there is no answer button :(
Rudik [331]

Answer:

oh for me there is maybe try reloading?

Explanation:

8 0
2 years ago
How can i change ip address <br>​
JulijaS [17]

I believe your answer would be:

1: Open the command prompt window. Do this by clicking the "Start" button, and then selecting "Run." In the window that appears, type "cmd" into the text box and click the "OK" button.

2: Release the computer's current IP address. To do this, type "ipconfig /release" into the command prompt window and press Enter.

3: Acquire a new IP address. Do this by typing "ipconfig /renew" into the command prompt window and pressing Enter. This should assign the computer a new IP address, which will be different from the previous address.

4: Cycle your modem's power. If the above steps don't work, you can try renewing your IP address by cycling your modem's power. Turn off both your computer and your modem (and your router, if you have one). Wait at least 5 minutes, then turn everything back on. If your computer is set to receive an IP address dynamically (the most likely configuration), you should be assigned a new IP address automatically.

5: Check to make sure your IP address has changed. To do this, you can log on to a number of different websites that tell you your IP address.

Hope I helped, if so may I get brainliest and a thanks?

Thank you, Have a good day! =)

7 0
3 years ago
A common and extremely useful feature of most online dictionaries is
choli [55]
A common and extremely useful feature of most online dictionaries is <em />interoperable browser.
4 0
3 years ago
Other questions:
  • For any element in keysList with a value greater than 50, print the corresponding value in itemsList, followed by a space. Ex: I
    8·1 answer
  • Which of these is an on-site metric for social media marketing?
    13·1 answer
  • You can execute three main types of linux commands. what are they?
    8·1 answer
  • 2) Complete the get_num_of_characters() function, which returns the number of characters in the user's string. We encourage you
    11·1 answer
  • Indenting the start and finish of segments
    8·2 answers
  • Why is it important to cite your sources?
    8·2 answers
  • How is a technical certificate like a computer-related associate degree?
    12·2 answers
  • Give me two reasons why return statements are used in code.
    10·2 answers
  • What would be a social networking page background for Sigmund Freud?
    15·1 answer
  • How does robotic process automation (rpa) differ from intelligent automation
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!