Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started