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
Which tool relies on the logged on user's certificate details to encrypt or decrypt files and folders? powershell bitlocker encr
grigory [225]
The tool relies on the logged on user's certificate details to encrypt or decrypt files and folders is the encrypting file system (efs).
It gives filesystem-level encryption as part of the improvement made on Microsoft Windows in version 3.0 of NTFS. This technology allows files to be visibly encrypted to secure confidential data from unsecured access to the computer. 
3 0
4 years ago
Can someone help me with python
pishuonlain [190]

Answer:

here

Explanation:

Python is an interpreted high-level general-purpose programming language. Its design philosophy emphasizes code readability with its use of significant indentation.

7 0
3 years ago
Which is better intel or amd real debate.
natima [27]

I believe Intel is better at handling games. Not saying AMD isn't good, just not as good. AMD is better for handling multiple task. I personally don't mind either.

8 0
3 years ago
Read 2 more answers
I re-made the human version of Daddy Dearest from Friday Night Funkin
schepotkina [342]
I like the second one better xx
6 0
3 years ago
Read 2 more answers
Question :
BlackZzzverrR [31]

Answer:

D

Explanation:

Search engine optimization (SEO)

4 0
3 years ago
Other questions:
  • What did the use of steam engines in printing presses lead to the development of?
    14·1 answer
  • The         provides access to the Internet; may also be internal
    5·1 answer
  • What OS is most commonly used by businesses?
    11·1 answer
  • Most sim cards allow ___________ access attempts before locking you out.
    10·1 answer
  • Why is time management considered a soft skill
    10·2 answers
  • An
    9·1 answer
  • Write<br> algorithm to read 100 numbers<br> then display the largest.
    9·1 answer
  • Let f(w) = 2w^3 - 5. Let z = 2. What is f(z)?​
    6·1 answer
  • Which of the following tabs on the Ribbon contains the command to add a Quick Part to a document? A Design B Insert C View D Hom
    7·1 answer
  • What type of program would you use to create a personal budget?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!