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]
4 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]4 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
Create a loop that will output all the multiples of 5 that are greater than zero and less than 60 (do not include 60). 5, 10, 15
DiKsa [7]

Answer:

Explanation:

Let's do this in python

(a) Between 5 and 60 and divisible by 5

for i in range(5, 60/5):

    print(5*i)

(b) Less than 200 and divisible and 2 and 7

for i in range(1, int(200/14) + 1):

    print(14*i)

(c)Sum of multiple of 8 that are between 100 and 500

sum_result = 0

for i in range(100, 500):

    if i % 8 == 0:

         sum_result += i

print(sum_result)

(d)sum of all odd numbers between 20 and 10

sum_odd = 0

for i in range(10, 20):

    if i % 2 == 1:

         sum_odd += i

print(sum_odd)

3 0
3 years ago
Lee purchased a new pc from dell computer's web site. he purchased his product via a(n) ________.
olga55 [171]
A <span>direct distribution channel if I'm not wrong.</span>
4 0
4 years ago
Which of the following policy guidelines specifies the restrictions on user access
Levart [38]

The policy guidelines that specifies such restrictions on user access can be referred to as: A. Least privilege.

<h3>What is the Least Privilege Principle?</h3>

The least privilege principle can be described as a concept in information security and policy guidelines that gives a user minimum permission or levels of access that they are needed to execute a tasks.

Therefore, the policy guidelines that specifies such restrictions on user access can be referred to as: A. Least privilege.

Learn more about least privilege on:

brainly.com/question/4365850

6 0
3 years ago
Linda works from home occasionally and needs to set up her computer at work so she can remote in from her home office. Which too
qwelly [4]

Explanation:

Check the type of hard drive installed.

hope this helps you ❣️

4 0
3 years ago
Why are cable networks such as mtv and cnn more profitable than the big four broadcast networks?
aalyn [17]
<span>Cable television was developed to deliver broadcast television signals to communities with poor reception.
</span><span>Cable networks such as MTV and CNN are more profitable than the big four broadcast networks because </span>viewers pay for subscriptions and companies pay for advertising. Viewer pay monthly fee for viewing cable TV and companies pay in order their campaign to be broadcasted.
8 0
4 years ago
Other questions:
  • A ____ appearing in the main text of a document indicates a footnote or endnote.
    15·1 answer
  • Energy is defined as stored energy
    13·2 answers
  • What is used to determine when the communications channels are clear and when a device is free to transmit data
    6·1 answer
  • What is Mainframe computer​
    14·1 answer
  • Your company wants to use an IoT device but wants to make sure it does not interfere with other RF devices that use the 2.4 GHz
    12·1 answer
  • What is the term used to describe a computer system that can store literary documents, link them according to logical relationsh
    5·1 answer
  • What is one purpose of an essay’s conclusion paragraph?
    13·1 answer
  • The derivative of <br><img src="https://tex.z-dn.net/?f=ln%20%5C%3A%20%20%7Cx%7C%20" id="TexFormula1" title="ln \: |x| " alt="l
    7·2 answers
  • ___________allows you to see what the final web page will look like.​
    10·1 answer
  • PLZZZZZ help will give brainleist <br> Two common sound files are?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!