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
fgiga [73]
3 years ago
10

Write a program that responds to a positive integer passed on the command line with the number of bits needed to express that nu

mber in binary.
Computers and Technology
1 answer:
jolli1 [7]3 years ago
7 0
You may want to rephrase the output.

```
#!/usr/local/bin/python3

### Written for Python version 3! ###

import sys

num = int( sys.argv[ 1 ] )
exp = 0

while( num > 2**exp ):
    exp += 1

print( "It takes %d bits to get to the center of a Tootsie Roll" % exp )

exit( 0 )
```


You might be interested in
Validating the results of a program is important to a. correct runtime errors b. make sure the program solves the original probl
elena-s [515]

Answer:

b. make sure the program solves the original problem

Explanation:

This is important so as to avoid logical errors. Logical errors unlike compiler or run time errors will not stop your code from compilling and executing but after your program compiles and runs, but does the wrong thing by given you unexpected results

This is the reason why validation of results after your code is completed is important in this way you are sure the program solves the original problem.

4 0
3 years ago
One of the ways to create a horizontal navigation menu from an unordered list is to a. set the display property of the element w
Gennadij [26K]

Answer: a. set the display property of the element within each li element to inline

Explanation: In an unordered list, <em>ul</em> signifies the list and <em>li</em> signifies the elements in the list. When you want to display the elements in a list in a horizontal form, for example if you need a horizontal menu, a quick way of doing this is setting the display of li to inline by writing it as follows in css:

<em>li { </em>

<em>Display: inline; </em>

<em>} </em>

This will order the elements in the list into the form of a horizontal menu .

8 0
3 years ago
Create html code showing heading tags​
kow [346]

Answer:

Assuming you mean the HTML5 head tag, then this may work for you:

<!DOCTYPE HTML>

<html lang="en">

<head>

<title>My Very Awesome Website</title>

<link href="./css/main.css" rel="stylesheet"  />

<meta name="viewport" content="width=device-width, initial-scale=1" />

</head>

<body>

<h1>Hey look</h1>

<p>This is my awesome website!</p>

<h3>Note</h3>

<p>This website is supposed to be 100% awesome!</p>

</body>

</html>

3 0
2 years ago
What is malware? What are some signs that malware may be impacting the performance of your computer? How can you avoid malware?
Anni [7]

Answer:

Malware is a type of software that is specifically designed to disrupt, damage, or gain unauthorized access to a computer system. Malware can be spread through email attachments, online advertisements, websites, and other methods.

Some signs that malware may be impacting the performance of your computer include:

  • Your computer is running more slowly than usual
  • Your computer crashes frequently
  • Your computer has pop-up ads or other unwanted behavior
  • Your default homepage or search engine has changed without your permission
  • You see new icons or programs on your desktop that you didn't install

To avoid malware, you should be cautious when browsing the internet and avoid visiting suspicious websites. You should also avoid opening email attachments from unknown senders, and be wary of online advertisements. You can also protect your computer by using antivirus software and keeping it up to date.

3 0
1 year ago
A string variable can hold digits such as account numbers and zip codes.<br><br> FALSE<br><br> TRUE
gavmur [86]
True. The second one is right
6 0
3 years ago
Other questions:
  • What is the "host" in a typical email address?
    14·1 answer
  • "The fact that we could create and manipulate an Account object without knowing its implementation details is called"
    9·1 answer
  • Commands are organized into tabs on the
    8·2 answers
  • Tasks:_______.
    7·1 answer
  • Which part of a computer takes the text and pictures on your screen and prints them onto paper?
    6·1 answer
  • What is not true about contracts?
    12·2 answers
  • Suppose a byte-addressable computer using set-associative cache has 2 16 bytes of main memory and a cache size of 32 blocks and
    10·1 answer
  • Need answer Asap!!!! Which file type is the best choice if the image will be made into a billboard?
    12·1 answer
  • Types of Hazards Mitigation Measures
    8·2 answers
  • A user has become compromised as a result of visiting a specific web page, without clicking on any kind of content. What type of
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!