Answer:
448 strings
Explanation:
Each bit string can be filled by two ways either 0 or 1. If the bit strings of length contain the substring '111000' we therefore need a substring of length 6.
The selection of bits starts from the 1st bit to 7th bit enclosing the substring 111000 and ensuring that the length 6 are all filled. So, there will be 7 ways to contain this substring.
The total ways to contain this substring = 7*2^6 =448
Therefore 448 strings of length 12 contain the substring '111000'.
To accomplish this without using a loop,
we can use math on a string.
Example:
print("apple" * 8)
Output:
appleappleappleappleappleappleappleapple
In this example,
the multiplication by 8 actually creates 8 copies of the string.
So that's the type of logic we want to apply to our problem.
<span>def powersOfTwo(number):
if number >= 0:
return print("*" * 2**number)
else:
<span>return
Hmm I can't make indentations in this box,
so it's doesn't format correctly.
Hopefully you get the idea though.
We're taking the string containing an asterisk and copying it 2^(number) times.
Beyond that you will need to call the function below.
Test it with some different values.
powersOfTwo(4) should print 2^4 asterisks: ****************</span></span>
Answer: Option 'B'
Explanation: They will be referred to as a manufacturing company because of they make the necessary part themselves not buy it from somewhere else.
Answer:
The answer for this question is b Add to
Answer:
The answer to the following question is Communications & Information management
.
Explanation:
National Incident Management System (in short NIMS), is the comprehensive and national approach to how state, tribal, territorial, federal and local responders reacts and responds during the emergency.
The components of NIMS are:
- Command and Management,
- Resource Management,
- Preparedness,
- Communication & Information,
- Ongoing Management and Maintenance and
- Supporting Technologies.