Question: Before starting the first table, enter the following assignment statement into the interactive shell: > > > s = 'Hello World' Now that you have
Before starting the first table, enter the following assignment statement into the interactive shell:
s 'Hello World'
Now that you have the variable s enter the following statements in the order they are presented. Many of the commands below are statements, not expressions. Hence, they are all followed by a print statement showing some output. In each case, write down what you see in the second column. If the command results in an error, simply write Error.
Statement Output
t tuples
printt:
HelloWorl
s strt
prints:
HelloWorld
s introcs.joint
prints
HelloWorld
s introcs.joint
prints
error
t introcs.splits
printt
Hello "World"
t introcs.splitso
printt
hell wrld
For the next table, we want you to reassign s as follows:
s str tups'
In the table below, the commands are all missing something, represented by a box. That something may be a literal or a variable. The second column displays the output. You need to fill in the box to give the desired output. If you are confused, go back and look at your answers in the first table.
Statements Output Missing
ts
printtstrtups
tuple
s strt
prints:strtups
s introcs.joint
prints strtups
s introcs.joint:
prints tups
t introcs.s
printtstr 'tups'
t introcs.splits
printtsr 'ups'
s
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
