Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
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