Question: Which of the following code snippets uses Python to define a function called upper_slice, which takes in a string and an integer as arguments and
Which of the following code snippets uses Python to define a function called upper_slice, which takes in a string and an integer as arguments and returns the string slice up until the index of that integer, converted to all caps? Sample input 1: 'Greetings: 5 Sample output 1: 'GREET Sample input 2: 'Hello, World!', 2 Sample output 2: THE None of these def upper slice text, number): return text number], upper def upper slice(text, number) text[0, number).upcase end def upper slice(text): return text.upper function upper slice(text, number) { return text.sliceco, 5).touppercase: }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
