Answer:
python:
f = open("\info\bikes.txt", "r")
print(f.read())
Explanation:
Answer:
Explanation:
Well here you only have to add 2 new horses .... so simply what you can do is find 2 slots where the gap is maximum ... lets take the given example in detail to understand the same.... here 10001001000010 here you can observe that the difference between the first two filled slots is 3 then 2 then 4 then 1....... make it a separate array ...... now as i said that we just need to place two new horses so we just need two of the biggest numbers from this array and place the new horses at the center of the corresponding slots ... like here 3 and 4 are greatest ... so one horse is placed in between the gap corresponding to 3 while other at 4 ..... after making the new array answer can be find in linear time itself... I hope this makes sense ....
Now lets understand how to program it easily so firstly after scanning all stuff ..... we will make a gap array .... then just think now what we will do is find the greatest two numbers then again putting the horses and then find our answers .... so now an easy approach is that instead of making the string again and again searching for answer .... what we do is just do half of the two greatest ones and again find the greatest one in array....
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]
Answer:
Don't respond to it. Either leave it there, or just delete it. It is most likely spam or a scammer trying to get your information. Don't respond, please.
Answer:
this is the method of processing wood