What is the output of the following program aWord If I only

What is the output of the following program: aWord =\"If I only\" anotherWord - \"had\" last Phrase - \"a brain\" print(aWord +anotherWord + lastPhrase) Explain why the output of the below program is The same letter instead of Different letters aSentence = \"We are off to see the wizard...\" if aSentence[26] - aSentene[-5]: print(\"The same letter\") else: print(\"Different letters\") Add two lines to the following python code (currently only 1 line, you cannot edit the existing line): reformatMe = \"VICTOR E. VIKING\" So that when the three-line program is executed, the output is: Victor e. viking Explain what K meant by the phrase Strings are Immutable Explain why the output of the following program is 2 8: kennel Residents - \"12 dogs, 3 cats, and a zebra\" count = 0 for aChar in kennel Residents: count = count + 1 print (count) Explain the difference between list, nested list, and sublist. Explain the difference between list append and list concatenation True or False, lists are mutable.

Solution

1. The output of the code is: If I onlyhada brain

2. aSentence[26] which means 27th letter in the given string, i.e., r.

aSentence[-5] which means 5th letter from last in the given string, i.e., r again.

And as both these letters are the same, the output of the code will be \"The same letter\"

3. reformatMe = \'VICTOR E. VIKING\'
reformatMe = reformatMe.lower()
reformatMe = reformatMe[0].upper() + reformatMe[1:]

 What is the output of the following program: aWord =\

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site