Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Here is a Python program named Lab73py that accomplishes the specified tasks def main Pro...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