Answers for "Create a string made of the first three and the last three characters of the original string s and return the new string, so 'intelligence' creates 'intcne'. However, if the string length is less than 3, return instead the empty string. python"

0

Create a string made of the first three and the last three characters of the original string s and return the new string, so 'intelligence' creates 'intcne'. However, if the string length is less than 3, return instead the empty string. python

string = input('Enter the string: ')
first = string[:3]
last = string[-3:]
if len(string) <= 3:
    print(string)
else:
    print(first + last)
Posted by: Guest on October-18-2021

Code answers related to "Create a string made of the first three and the last three characters of the original string s and return the new string, so 'intelligence' creates 'intcne'. However, if the string length is less than 3, return instead the empty string. python"

Python Answers by Framework

Browse Popular Code Answers by Language