Answered step by step
Verified Expert Solution
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 =
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
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