Learner777
Badges: 21
Rep:
?
#1
Report Thread starter 2 years ago
#1
What is output by the following algorithm?
notice = "Please do not walk on the grass"
start=pos (r notice," ")
end = pos (notice, "t")
x = substring (0,start, notice)
stringLength=len(notice)
y = substring (end+2, stringLength - 1 , notice)
print ("x = "x)
print (“y= “ , y)
print (x + y)
0
reply
ym123
Badges: 13
Rep:
?
#2
Report 2 years ago
#2
It will output
x = Please
y = walk on the grass
Please walk on the grass
0
reply
winterscoming
Badges: 19
Rep:
?
#3
Report 2 years ago
#3
(Original post by Techtech123)
It will output
If this is the OP's homework then they're not going to learn anything by simply being given the answer.
Last edited by winterscoming; 2 years ago
0
reply
ym123
Badges: 13
Rep:
?
#4
Report 2 years ago
#4
(Original post by winterscoming)
If this is the OP's homework then they're not going to learn anything by simply being given the answer.
I actually Direct Messaged the reasoning to him.
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Has your education been disrupted this academic year due to the pandemic?

Yes (1)
100%
No (0)
0%

Watched Threads

View All
Latest
My Feed