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
What service provides realtime delivery of voice or streaming media?
k0ka [10]
YouTube, Twitch, and Beam are media that you can stream on.
(If that's what you are looking for.)
8 0
3 years ago
How do you get stickman worriers
ira [324]
You go online and find the answer
8 0
3 years ago
What are the advantages and disadvantages of globalization and new technologies?
snow_lady [41]

Answer:

the advantage is the better the tech. the easier life gets

the disadvantages is the better it gets. the more danger it puts us in (depending on the tech) and the more lazy we become

7 0
3 years ago
Which of the following sorting algorithms is described by this text? "Split the array in two parts. Take each part, and split it
BartSMP [9]

Answer:

Option(B) i.e "Merge sort " is the correct answer to the given question .

Explanation:

The merge sort follow the approach of divide and conquer technique .It means firstly it divided the given array into the sub parts that sub parts are sorted in comparing the first  value with the adjacent value and perform selection sorting in them it means we swap the value if necessary. This process will continue until all the elements are checked .

  • When the sub parts are  arranged  then we will combine them and getting the new or original array that is in sorted order.
  • When we perform the merge sort  the extra memory is used which is drawback of merge sort .
  • All the other options are not Splitting  the array in two parts and perform sorting so these are incorrect option .
5 0
3 years ago
A = [2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 33 34 35 36 37 38 39 40]
vova2212 [387]

Answer:

C = a./b

Explanation:

In MATLAB, the following command:

C = A./B

Performs the element by elemet division of A and B. This comand is called Right-array division.

So, in your case, we could divide A by B element by element, only using fully-vectorised code (ie. no loops), with the following code:

a = [2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 33 34 35 36 37 38 39 40];b = [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 43 45 47 49 50 54 59 60];C = a./b;

C would be the element by element division of A and B, with no loops.

5 0
3 years ago
Other questions:
  • Fax machines, voice mail, electronic mail, and electronic conferencing are all examples of _________.
    15·2 answers
  • Which team won the first World Series ?
    11·2 answers
  • When performing actions between your computer and one that is infected with a virus, which of the following offers NO risk of yo
    11·1 answer
  • Averigua las diferentes intensidades, la potencia total y el gasto en € (de un mes de 30 días con el equipo conectado todo el ti
    12·1 answer
  • Note: the println() function prints out a line of text with the value that you pass to it - so if you say println("Hi"), it will
    5·1 answer
  • Write a Java program that reads an 8-bit binary number from the keyboard as a string and then converts it into decimal. For exam
    11·1 answer
  • Recursion occurs when a function (calls itself/ calls another function/ calls a function from the python standard library)
    5·1 answer
  • Complete the sentence
    6·2 answers
  • Please help me with this coding problem :)
    6·1 answer
  • In the year, , the American Department of Defense put a military research network, called ARPANET online.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!