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 )
```
Answer:
<h2>YEET B </h2>
Explanation:
Sorry
Its B: a type of what-if analysis that allows a user to define multiple variables for multiple functions or formulas
(i think)
Answer:
Explanation:
( n cards are there initially )
we pick out the first card in random it takes n-1 comparisons to figure out
its Equivalence card - n-1 steps
Two cards have been eliminated ( this leaves us with 2 and n-2 cards)
we pick out the 2nd card in random it takes n-3 comparisons to figure out
its Equivalence card - n-3 steps
we continue to do this.. till all cards are exhausted ( leaves us with 2
and n-4 cards again)
the last comparison will
have
- n-(n-3)
the sum of all these steps - (n-1) + (n-3) + (n-5) + .........+
(n-(n-3))
if you draw this in the form of a tree.
n - n
2
n-2 - n
2
n-4 - n-2
2
n-6 - n-4
2
n-8 - n- 6
the height of the tree will be log n , sum @ each level is at most n
Answer:
The solution code is written in Python 3.
- def convertDate(date_string):
-
- date_list = date_string.split("/")
-
- for i in range(0, len(date_list)):
- date_list[i] = int(date_list[i])
-
- return date_list
-
-
- print(convertDate('06/11/1930'))
Explanation:
Firstly, create a function convertDate() with one parameter, <em>date_string</em>. (Line 1).
Next, use the Python string <em>split()</em> method to split the date string into a list of date components (month, day & year) and assign it to variable <em>date_list</em>. (Line 3) In this case, we use "/" as the separator.
However, all the separated date components in the <em>date_list</em> are still a string. We can use for-loop to traverse through each of the element within the list and convert each of them to integer using Python<em> int() </em>function. (Line 5 - 6)
At last return the final date_list as the output (Line 8)
We can test our function as in Line 11. We shall see the output is as follow:
[6, 11, 1930]