Complete the code to get the first character of the string.
first_char = my_string[[1]]In Python, string indexing starts at 0, so the first character is at index 0.
Complete the code to get the substring from index 2 to 5 (exclusive).
substring = my_string[[1]]Python uses slice notation with a colon to get substrings: start index inclusive, end index exclusive.
Fix the error in the code to concatenate two strings correctly.
full_string = str1 [1] str2In Python, the '+' operator concatenates strings.
Complete the code to create a dictionary with words as keys and their lengths as values, only for words longer than 3 characters.
lengths = {word: [1] for word in words if len(word) > 3}The key is the word itself (no extra syntax), and the value is the length of the word using len(word).
Fill all three blanks to create a dictionary with uppercase words as keys and their lengths as values, only for words shorter than 5 characters.
result = { [1]: [2] for word in words if len(word) [3] 5}Keys are uppercase words using word.upper(), values are lengths with len(word), and the condition checks words shorter than 5 using <.