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]
2 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]2 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
6, Answer the following questions.0<br>a What is software?​
nekit [7.7K]

Answer:

Software is a set of instructions, data or programs used to operate computers and execute specific tasks. Opposite of hardware, which describes the physical aspects of a computer, software is a generic term used to refer to applications, scripts and programs that run on a device. Software can be thought of as the variable part of a computer, and hardware the invariable part.

Software is often divided into categories. Application software refers to user-downloaded programs that fulfill a want or need. Examples of applications include office suites, database programs, web browsers, word processors, software development tools, image editors and communication platforms.

Explanation:

Software is a set of instructions, data or programs used to operate computers and execute specific tasks. Opposite of hardware, which describes the physical aspects of a computer, software is a generic term used to refer to applications, scripts and programs that run on a device. Software can be thought of as the variable part of a computer, and hardware the invariable part.

Software is often divided into categories. Application software refers to user-downloaded programs that fulfill a want or need. Examples of applications include office suites, database programs, web browsers, word processors, software development tools, image editors and communication platforms.

5 0
3 years ago
How are special characters added to a Word document? Check all that apply.
Musya8 [376]

Answer:

by using keystroke codes

by using the character map

by using the Symbols command group

by using the Symbol drop-down arrow

6 0
3 years ago
Read 2 more answers
Many businesses use robotic solutions. Which department of the food and beverage industry uses robotic solutions on a large scal
Alenkinab [10]

Answer:

Its packing you're welcome :)

Explanation:

7 0
3 years ago
Read 2 more answers
Queries are questions true or false?
makkiz [27]
True

…………………………………………………..
5 0
3 years ago
Which of the following websites can help you learn about general career trends?
Ber [7]
The answer is vocational information center as this area or website provides a person or a student to explore careers that could be suitable to his or her liking and to show careers or professions' role as they work. This website is a way of educating an individual of having to provide informations regarding about careers.
8 0
2 years ago
Other questions:
  • In your presentation you added a text box to?
    5·1 answer
  • What block cipher mode of operation involves each ciphertext block being fed back into the encryption process to encrypt the nex
    12·1 answer
  • On what basis can you categorize the generations of computers?
    5·1 answer
  • Write a method drivingCost() with input parameters drivenMiles, milesPerGallon, and dollarsPerGallon, that returns the dollar co
    10·1 answer
  • Was the type writer the first part of the keyboard? ​
    8·1 answer
  • The moon has less mass than the earth, so what happens to objects on the moon?
    11·1 answer
  • Match the component to its function. resistor inductor capacitor battery transistor This component stores a temporary charge. ar
    7·2 answers
  • Your network has four Hyper-V hosts, which are running three domain controllers and about 10 member servers. Three of the member
    10·1 answer
  • 14. Which of the following is NOT a
    6·2 answers
  • Hi I got a new phone and my photos are taking so long to download, on Friday it was at 13000 what do I do it’s taking so long
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!