Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[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

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

Show the properties and structure of allotropes of carbon.

Answered: 1 week ago