Answer:
1.word = "George slew the dragon"
startIndex = word.find('dr')
endIndex = startIndex + 4
drWord = word[startIndex:endIndex]
2. sentence = "Broccoli is delicious."
sentence_list = sentence.split(" ")
firstWord = sentence_list[0]
Explanation:
The above snippet is written in Python 3.
1. word is initialized to a sentence.
Then we find the the occurence of 'dr' in the sentence which is assign to startIndex
We then add 4 to the startIndex and assign it to endIndex. 4 is added because we need a length of 4
We then use string slicing method to create a substring from the startIndex to endIndex which is assigned to drWord.
2. A string is assigned to sentence. Then we split the sentence using sentence.split(" "). We split based on the spacing. The inbuilt function of split returns a list. The first element in the list is assigned to firstWord. List uses zero based index counting. So. firstWord = sentence_list[0] is use to get first element.
Answer:
When myMethod is invoked by a method in the same class as myMethod.
Explanation:
When you are in a class, it is like a different enviroment and within that class you can call a method without using the dot notation because you are still within the class.
Outside the class and despite the type of method, public, private or static, the dot notation will be required.
Answer:
b. white-hat hacker
Explanation:
A White-hat Hacker, also known as an Ethical Hacker is an information security specialist, known for performing penetration testing and checks in search for information and communications system's vulnerabilities on demand for his/her clients.
These efforts are meant to find security risks before someone else does, who could cause any kind of damage to the systems or unauthorized access to sensitive information
Vehicle maintenance is important because without them the vehicle would not function properly and could be a safety hazard. Vehicle safety is important because without it we could end up seriously injured or even killed, vehicles can be very dangerous if handled irresponsible and the proper safety methods are not used.<span />
The main characteristic of a company with suggests that it operates with an informal work culture is flexible working hours. With this kind of work culture, <span>workers are allowed to alter their workday start and finish times; and are not required to strictly follow the traditional work arrangements of the standard 9 a.m. to 5 p.m</span>