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
MA_775_DIABLO [31]
3 years ago
7

The following code should take a number as input, multiply it by 8, and print the result. In line 2 of the code below, the * sym

bol represents multiplication. Fix the errors so that the code works correctly: input ("Enter a number: ") print (num * 8) The code above is pre-populated in your code editor. Hint: Remember that to think about the data type that the user will input. How can you make sure that their input is entered as a number?
Computers and Technology
1 answer:
Juli2301 [7.4K]3 years ago
6 0

Answer:

num = int(input("enter a number:"))

print(num * 8)

Explanation:

num is just a variable could be named anything you want.

if code was like this num = input("enter a number:")

and do a print(num * 8)

we get an error because whatever the user puts in input comes out a string.

we cast int() around our input() function to convert from string to integer.

therefore: num = int(input("enter a number:"))

will allow us to do  print(num * 8)

You might be interested in
When you park on a hill, think about which way _____.
Vinil7 [7]

I don't see why this is on a computer section but either way I would chose D because naturally when you park on a hill you would be cautious about your car going into motion down the hill so therefore you would think of which way gravity would pull your vehicle

7 0
2 years ago
Read 2 more answers
, how do you make this user <br> XtraCrispyIzzy<br> 12 characters or less for microsoft?
xxTIMURxx [149]

Answer:

Maybe take away the 'xtra'

8 0
2 years ago
16. A/An __________ is operated on the principle that the dying have special needs and wants that hospital personnel are too bus
marta [7]

Answer:

Hospices

Explanation:

A/An <u>Hospices</u> is operated on the principle that the dying have special needs and wants that hospital personnel are too busy to handle.

5 0
2 years ago
Read 2 more answers
Word can only print documents on one size of paper.<br><br> True or false
Elena L [17]

Answer:

False

Explanation:

You can always go in the document settings to change the layout and make the paper wider (landscape).

Layout > Orientation

Choose portrait or landscape

5 0
2 years ago
When the code that follows is executed, a message is displayed if the value the user entersvar userEntry = (prompt("Enter cost:"
Reika [66]

Answer:

The answer is "Option b".

Explanation:

In the given-code variable "userEntry" is defined that prompt the user to input value and in the next step, the conditional statement is used, which checks the input value is not a number and greater than 500 with use of OR operator. if the condition is true it uses the alert box to print the message, that's why in this question except "choice b" all were wrong.

4 0
3 years ago
Other questions:
  • What is the correct order of network types when categorized by their size or the physical area they cover, from largest to small
    10·1 answer
  • The _____ is a narrative description of the product, service, or information system.
    7·1 answer
  • A hard drive cannot be partitioned until the device _________ is set.
    15·1 answer
  • The most fundamental components of storage that users interact with are the:
    11·1 answer
  • A mother calls you to report that her 15-year-old daughter has run away from home. She has access to her daughter's e-mail accou
    6·2 answers
  • AddAll - Adds all the doubles in the string with each other. Note every double is separated by a semi-colon. AddAll("1.245;2.9")
    6·1 answer
  • Using the Impress program, you can add multimedia files, including audio, image, and video files, to the presentation
    13·2 answers
  • Computers that are joined together are called networks true or false
    10·1 answer
  • What refers to a set of instructions executed in order?
    6·1 answer
  • Assume that an int variable age has been declared and already given a value. Assume further that the user has just been presente
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!