File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 52
52
53
53
def get_first_letter (the_str ):
54
54
# Return the first letter of the string
55
- pass
55
+ return the_str [ 0 ]
56
56
57
57
check_that_these_are_equal (
58
58
get_first_letter ("The king granted them" ),
@@ -71,7 +71,7 @@ def get_first_letter(the_str):
71
71
72
72
def get_last_letter (the_str ):
73
73
# Return the last letter of the string
74
- pass
74
+ return the_str [ - 1 ]
75
75
76
76
check_that_these_are_equal (
77
77
get_last_letter ("The king granted them" ),
@@ -90,7 +90,7 @@ def get_last_letter(the_str):
90
90
91
91
def get_nth_letter (the_str , n ):
92
92
# Return the letter of the string at the specified index
93
- pass
93
+ return the_str [ n ]
94
94
95
95
check_that_these_are_equal (
96
96
get_nth_letter ("The king granted them" , 4 ),
@@ -110,7 +110,7 @@ def get_nth_letter(the_str, n):
110
110
def get_letters_between_four_and_eight (the_str ):
111
111
# Return the section of the string between indexes four
112
112
# and eight
113
- pass
113
+ return the_str [ 4 : 8 ]
114
114
115
115
check_that_these_are_equal (
116
116
get_letters_between_four_and_eight ("The king granted them" ),
You can’t perform that action at this time.
0 commit comments