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:
Option (b) is the correct and suitable answer for the above question.
Explanation:
The printer is a hardware which is used to convert the soft copy of an information to a printed copy (Hard copy) of information.
To use printer hardware a computer system needs a printer driver which is used to do the conversion from soft copy to a hard copy. Hardware printer uses only for the purpose to print the copy.
The option b says that the printer driver is used to convert the document into the form of that document which the printer can understand easily. It means conversion from soft copy to hard copy. Hence it is the right option.
The reason behind the other option which is not valid because--
Option a says that the printer driver is a code but it is a software.
Option c says that the printer driver is an interface but it is a software.
Option d says that the printer driver is a cache but it is a software.
Answer:
False
Okay now I have to go to my school--
Answer:
Virtual is the correct answer for the above question.
Explanation:
A Virtual organization is a collection which is used to connect the geographical people, organizational units, employees, individuals and groups for some communication purpose. Virtual means that there is some existence like physically but it is not physically present. So the organization also connects the person and gives the real scenario with the help of some software for communication.
The question states that if twitter uses email and other computing connections to connect people globally then it comes in the Virtual department because it follows the concept of the virtual department. Hence Virtual is the correct answer.
Answer:
Explanation:
Since no further information was provided I created the PayLevel function as requested. It takes the Ssn as input and checks it with a premade dictionary of Ssn numbers with their according salaries. Then it checks that salary against the average of all the salaries and prints out whether it is Above, Below, or Average. The output can be seen in the attached picture below.
employeeDict = {162564298: 40000, 131485785: 120000, 161524444: 65000, 333221845: 48000}
average = 68250
def PayLevel(Ssn):
pay = employeeDict[Ssn]
print("Employee " + str(Ssn) + " is:", end=" "),
if pay > average:
print("Above Average")
elif pay < average:
print("Below Average")
else:
print("Average")
PayLevel(161524444)
PayLevel(131485785)