Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
Count the number of characters in the string 'OpenAI'.
Consider using a function that counts string length.
Determine if the string 'hello' is a palindrome.
Think about what palindromes are.
What does strlen function return?
Think about the purpose of a length function.
True or False: The string 'level' is a palindrome.
Try reading it both ways.
Create a function to count the occurrences of each character in a string. Test your function using 'character'.
Think about initializing an empty dictionary and iterating through the string.
Develop a program that checks if a string is a palindrome, ignoring spaces and capitalization. Test it with 'A man a plan a canal Panama'.
Look into string methods for cleaning the input.
6 more questions in this section. Enroll free to practise them all.
Enroll free