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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!