Question: [Python] 3. Create 3 string variables and assign them to made-up string values of your choosing. Each string should have at least 3 words, and
[Python]
3. Create 3 string variables and assign them to made-up string values of your choosing. Each string should have at least 3 words, and at least one should have punctuation.
a)Using your variables, write one line of code to print a word that consists of the 3rd character from the first string, the 5th character from the second string and the last character from the third string. Remember that the index of the first character is 0, not 1.
b)Write a line of code to print one of your string variables backwards.
c)Write code to print one of your string variables with the end half at the beginning and the front half at the end (swap the halves). You may need multiple lines of code to effect the swap. Do not hardcode index values, because if your string variable changes, you want the program to keep working the same way. If you get stuck on this problem, try working it out on paper with numbers, then replace your numbers with a variable.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
