Question: 3 . Write a Python program ( named YourName _ SID _ Lab 7 c . py ) to a ) Let user enter a

3. Write a Python program (named YourName_SID_Lab7c.py) to
a) Let user enter a string
b) Extract the first five characters of the input string, and display the result
- Use slicing expression to select the first five characters (from 0 to 5) from the input string.
- Display the selected string on screen
c) Reverse the string and display the result
- Convert the string, with slicing in a reverse order.
- Display the string in reverse order, (e.g. Hello => olleH).
Sample Program Output:
CCIT4020 Laboratory 7: Section 3
Enter a string: Philosophy is a lovely subject!
First five characters are Philo
Reversed string is: !tcejbus ylevol a si yhposolinP
3 . Write a Python program ( named YourName _ SID

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!