Question: Python- I'm supposed to determine if the string 'garden' contains a lowercase letter 'r' or uppercase letter 'R'. I have to use if/else or for
Python- I'm supposed to determine if the string 'garden' contains a lowercase letter 'r' or uppercase letter 'R'. I have to use if/else or for loop to solve this problem. For some reason, my code won't run. Can someone explain what I'm doing wrong as well as provide with the proper source code. Thanks

1 2 def first(s): "Determineif a string contains a lowercase or uppercase r Test data: input: 'garden output: 'r' Params: s(string) Returns: (string) lowercase r 4 Ir II 10 s 'garden' if (s 'r'): =- 12 13 14 15 16 17 18 19 return ("The string contains a lowercase r" rcase r" return ("The string contains an else ass print(first(s))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
