Question: Python : write a program called First 4 Last 4 . ask user for a string read string from user print true if the first
Python : write a program called FirstLast
ask user for a string
read string from user
print true if the first four characters of string from left to right equal the last characters of the string from right to left
if the string is too short less than chars return false
HINT: if x "hello", then x is h x is e
examples:
python FirstLastpy
enter string: abc
string is too short
python FirstLastpy
enter string:
True
python FirstLastpy
enter string:
string is too short
python FirstLastpy
enter string: xx
False
python FirstLastpy
enter string: xxxxx
False
python FirstLastpy
enter string: xxxxx
True
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
