Question

1. Given the variable 's' containing the string value below, determine the value for the variable...

1. Given the variable 's' containing the string value below, determine the value for the variable result
after each of the following statements is executed or specify error if a Python exception would be
thrown:

s = "One plus Two plus Three = 6"

a.) result = s.replace('plus', '+')

b.) result = s[26].isdigit()

c.) result = s[29] + s[0]

d.) result = s[4:8] + s[13:17]

e.) result = s.upper()

f.) result = s.find('6')

g.) result = s[0:4].isalnum()

h.) result = s[::-1]

i.) result = s[10] * 3

j.) result = len(s)

k.) result = 'on' in s

l.) result = s.replace('=', 'equals'.upper())

m.) result = s[0] + s[19]

n.) result = s[::3]

o.) result = s.title()

p.) result = s[7:10].replace(" ", "i")

q.) result = s[11]

r.) result = s[24:27].title()

s.) result = s.lower()

t.) result = s.capitalize()

u.) result = s[9:12][::-1].upper()

v.) result = s[::-1].lower()[2]

w.) result = s.replace("plus", "+").replace('6', "Six")

0 0
Add a comment Improve this question Transcribed image text
Answer #1
One + Two + Three = 6
True
IndexError: string index out of range
plusplus
ONE PLUS TWO PLUS THREE = 6
26
False
6 = eerhT sulp owT sulp enO
www
27
False
One plus Two plus Three EQUALS 6
Oh
O uT uTe=
One Plus Two Plus Three = 6
siT
o
= 6
one plus two plus three = 6
One plus two plus three = 6
OWT
=
One + Two + Three = Six
Add a comment
Know the answer?
Add Answer to:
1. Given the variable 's' containing the string value below, determine the value for the variable...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT