Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for python. I get errors between 5-7. Appreciate it. 1) Print Hello and World on 2 separate lines (5 pts) 2) Name =

image text in transcribed

This is for python. I get errors between 5-7. Appreciate it.

1) Print Hello and World on 2 separate lines (5 pts) 2) Name = "Michael Jackson" (15 pts) Print first element of string at index 0 Take the slice on variable name with only index 0 to index 3 (hint: only make use of start index and end index numbers. This is called slicing) Get and print every second element. i.e. elements on index 0,2,4... (hint: make use of start, end index numbers along with the stride. This is called slicing with a stride(every 2nd element)) Get and print every second element in the range from index 0 to index 4. 3) Concatenate 2 strings: string 1 = " Michael Jackson" and string 2 "is the best" (5 pts) 4) Print a string "Michael Jackson" three times (5 Pts) 5) Replace old substring with a new target substring is the segment has been found in the string . That is, replace word Michael with Janet in the string "Michael Jackson is the best" (10 pts) 6) Find substring "Jack" in the main string "Michael Jackson" and return its index position. (hint: use the string method find) (5 pts) 7) Use For loop to print out elements of list A: A = [1,2,3,4,5,6,7,8,9] (5 pts)

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

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

Describe the three main levels of strategy.

Answered: 1 week ago

Question

What is human nature?

Answered: 1 week ago