117k views
2 votes
Using the slice operator, print your first, then last name.2. Print the length of your first name.3. Assume you have two variables: s='s' and p='p'. Using concatenation and repetition, write an expression that produces the string mississippi.

User Debo
by
3.8k points

1 Answer

4 votes

Answer:

Check the explanation

Step-by-step explanation:

we will be writing the below codes in answering the question above.

The Code:

name="Tony stark"

firstname=name[0:4]

lastname=name[5:]

print(firstname,lastname) #first one

print(len(firstname)) #second one

s='s'

p='p'

i='i'

result='m'+i+(s*2+i)*2+p*2+i #third one

print(result)

The output can be seen in the image below.

Using the slice operator, print your first, then last name.2. Print the length of-example-1
User Ryangus
by
3.8k points