Question
QUESTION 7 python The join() method of a list can be used to combine a. the items in the list into a string b. the
QUESTION 7
python
The join() method of a list can be used to combine
a. the items in the list into a string
b. the items in the list into a string that’s separated bydelimiters
c. two or more lists
d. two or more strings into a list
5 points
QUESTION 8
To access the first three characters in a string that’s storedin a variable named message, you can use this code:
a. first_three = message.split(0:2)
b. first_three = message.slice(0:2)
c. first_three = message[0:2]
d. first_three = message[1:3]
5 points
QUESTION 9
To determine the length of a string that’s in a variable namedcity, you can use this code:
a. len(city)
b. city.len()
c. length(city)
d. city.length()
5 points
QUESTION 10
To retrieve the fourth character in a string that’s stored in avariable named city, you can use this code:
a. city(4)
b. city(3)
c. city[4]
d. city[3]
5 points
QUESTION 11
What is the value of s2 after the code that follows isexecuted?
s1 = "118-45-9271"
s2 = ""
for i in s1:
if i != '-':
s2 +=i
s1.replace("-", ".")a. 118.45.9271
b. 118459271
c. 118-45-9271
d. 118 45 9271
5 points
QUESTION 12
What is the value of s3 after the code that follows isexecuted?
s1 = "abc def ghi";
s2 = s1[1:5]
s3 = s2.replace('b', 'z')
print(s3)a. azc d
b. zc de
c. zc d
d. abc d
e. bc d
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