answer.
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]
2 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]2 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
Write pseudocode for a program which will ask a user to enter two numbers a and b. It then asks what operation is to be performe
sleet_krkn [62]

get int input for a

get int input for b

get string input for operator

if a is not int or b is not int throw exception and print error

if operator is not * / // or % throw exception and print error

if operator is * do multiplication of a and b and make answer c

else if operator is / do division of a and b and make answer c

else if operator is // do floor division of a and b and make answer c

else if operator is % do floor modulo of a and b and make answer c

print c

5 0
2 years ago
What term best describes the grammatical rules for writing proper code? paths syntax hyperlinks declarations
Ray Of Light [21]

Answer:I believe that the most fitting answer for this question would be D., "conventions." All styles and periods of literature have their own conventions for spelling, punctuation, grammar, and capitalization. They change over the centuries and between different writers. You can also find this answer by using the process of elimination. Clarity, context, and coherence do not really have anything to do with these things. Hope this helps.

8 0
2 years ago
Read 2 more answers
How do I open the Excel workbook "Revenue.xls" from the default directory?
Kobotan [32]
<span>Follow the following steps to open "Revenue.xls":

Step 1:
Open Microsoft Excel.

Step 2:
Click on the "File" button (at top left).

Step 3:
When you click on the File button, the list will pop up which will contain the option "Open."
Click "Open".

Step 4:
Now select the "Revenue.xls" file and open it!

That's it! :)</span>
4 0
1 year ago
If Mark is developing a website to be optimized for mobile devices, what would be the top-level domain?
umka2103 [35]

Answer:

A top-level domain or the TLD is the domain at the highest level in the hierarchy of the DNS. And that means in the Internet DNS. Also, the top-level domain is installed in the namespace toot zone. And the top-level domain is the .com, in general, to be named as the best one. The next two are the .net and .org. But since it is required to optimize the website for the mobile devices, we should select here .com.

Explanation:

Please check the answer section.

5 0
1 year ago
Which among the following enhances WS-Security to facilitate a mechanism for issuing, renewing, and validating security tokens?
Aleksandr-060686 [28]

Answer:

a. WS-Trust

Explanation:

WS-Trust can be defined as a WS-specification as well as OASIS standard that help to provides extensions to WS-Security, in order to facilitate a mechanism for issuing, renewing, as well as validating of security tokens which is why the aim and objectives of WS-Trust is to help and enable applications to construct trusted SOAP message exchanges.

Nevertheless WS-Trust enables the issuance as well as the dissemination of credentials within several and various trust domains.

5 0
1 year ago
Other questions:
  • If a car's is malfunctioning, people in the car will become ill when driving long distances, especially if the windows are close
    6·2 answers
  • What is the formula equivalent to the function =SUM(B1:B5)?
    11·2 answers
  • c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
    5·1 answer
  • Which Internet of Things (IoT) challenge involves the difficulty of developing and implementing protocols that allow devices to
    11·1 answer
  • Assume that a program uses the named constant PI to represent the value 3.14. The program uses the named constant in several sta
    9·1 answer
  • Write multiple if statements: If carYear is before 1968, print "Probably has few safety features." (without quotes). If after 19
    6·1 answer
  • Budget Analysis (use while loop) Write a program that asks the user to enter the amount that he or she has budgeted for a month.
    5·1 answer
  • Determining the Services Running on a Network Alexander Rocco Corporation has multiple OSs running in its many branch offices. B
    10·1 answer
  • Write an expression that continues to bid until the user enters 'n'.
    9·1 answer
  • In the file BankAccount.java, build a class called BankAccount that manages checking and savings accounts. The class has three p
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!