Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Performance Engineering 10th European Workshop Epew 2013 Venice Italy September 17 2013 Proceedings

Authors: Maria Simonetta Balsamo ,William Knottenbelt ,Andrea Marin

2013 Edition

3642407242, 978-3642407246

More Books

Students also viewed these Programming questions

Question

1. Identify the four stages of the product lifecycle.

Answered: 1 week ago