PythonSkills.org
Courses
Exercices
Challenges
Quizzes
Open console
0 points
Get started
Loading...
All Challenges
Loading...
Not Solved
Get last four characters
Write a function that takes a string and returns the last four characters. If the string has fewer than four characters, return the entire string.
Beginner
Hint
sample input: "OpenAI"
sample output: enAI
Run Tests
Clear Tests
Test Output:
Show Solution
Show Code
Loading...
Next challenge: Extract first three characters