Practise question

1 Like

@prashanshamurty99

The output for 42 no. question is h

1 Like

@prashanshamurty99

The def function in the above screenshot is used to check if the letter is passed in the function as parameter is in lower case or not.
Variable key is used in this program as a counter whatever the value will be +1 to the output.

When if condition satisfies it will fetch the integer value of the passed letter through ord keyword and add 1 to it , than again convert the new integer value into a character using the char keyword and than return the output.

And if the condition doesn’t satisfies than it will print the letter that you passed the function.