Question: Write a Python program (named Lab7_3.py) to a) Let user enter a string b) Extract the first five characters of the input string, and

Write a Python program (named Lab7_3.py) to a) Let user enter a string b) Extract the first five characters

Write a Python program (named Lab7_3.py) to a) Let user enter a string b) Extract the first five characters of the input string, and display the result o Use slicing expression to select the first five characters (from 0 to 5) from the input string. o Display the selected string on screen c) Reverse the string and display the result o Convert the string, with slicing in a reverse order. o Display the string in reverse order, (e.g. Hello => olleH). Hint: List.reverse() Sample Program Output: CCIT4020 Laboratory 7: Section 3 Enter a string: EIS is a lovely subject The first five characters are EIS i Reversed string is: tcejbus ylevol a si SIE By Chan Tai Man... 1234567@ HKUSPACE Community College ...

Step by Step Solution

3.66 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is a Python program named Lab73py that accomplishes the specified tasks def main Pro... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!