Write a small Python program and code each string function ormethod statement and
output the result the screen to understand how the string objectworks. For string values do NOT put ' or " around the value youtype into Blackboard.
1
sQuote = "Python is a great programming language"
What is the result of the following code:
sQuote[2:] ____________
2
sQuote = "Python is a great programming language"
What is the result of the following code:
sQuote[2:5] ____________
3
sQuote = "Python is a great programming language"
What is the result of the following code:
sQuote.isupper()____________
4
sQuote = "Python is a great programming language"
What is the result of the following code:
len(sQuote) ____________
5
sQuote = "Python is a great programming language"
What is the result of the following code:
sQuote.upper()____________
6
sQuote = "Python is a great programming language"
What is the result of the following code:
sQuote.lower()____________
7
sQuote = "Python is a great programming language"
What is the result of the following code:
sQuote.index("great")____________
8
sQuote = "Python is a great programming language"
What is the result of the following code:
sQuote[8] ____________
9
sQuote = "Python is a great programming language"
What is the result of the following code:
sQuote.find("Dan")____________
10
sQuote = "Python is a great programming language"
What is the result of the following code:
sQuote == "Brian"____________
11
sQuote = "Python is a great programming language"
What is the result of the following code:
sQuote.replace("a","@")____________
12
sQuote = "Python is a great programming language"
What is the result of the following code:
sQuote == "Python"____________
13
sQuote = "Python is a great programming language"
What is the result of the following code:
sQuote.lower().endswith('Age') ____________
14
sQuote = "Python is a great programming language"
What is the value of sResult after the following codeexecutes:
sResult = sQuote[:9] ____________
15
sQuote = "Python is a great programming language"
What is the result of the following code:
sQuote.rfind('a') ____________
16
sQuote2 = "Python"
What is the result of the following code:
sQuote2[::-1] ____________
17
sQuote2 = "Python"
What is the result of the following code:
sQuote2 + "is awesome!" ____________
18
sQuote2 = "Python"
What is the result of the following code:
sQuote2[-4:] ____________
19
sQuote2 = "Python"
What is the result of the following code:
sQuote2[-4:-2] ____________
20
sQuote3 = "-->Python<--"
What is the result of the following code:
sQuote3.strip('-') ____________