Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Create a string and print its first character.
Use indexing to access the first character.
What will be printed for the last character of the string 'Hello'?
Use negative indexing.
What index value would you use to access the last character of a string in Python?
Think about accessing elements from the end of the string.
True or False: f-strings can only include string variables.
Consider what types can be converted to string.
Create a program that asks for a user's full name and age. Then, produce a formatted string that states 'Hello, [First Name]! You are [Age] years young!'
Remember to split the full name and format it correctly.
Write a function that takes a string and replaces all instances of specific words with another word. Demonstrate it using the sentence 'Python is easy, Python is fun'.
Focus on how to use the replace() method within a function.
5 more questions in this section. Enroll free to practise them all.
Enroll free