User
Please provide 7 Coding Dicitnoary Question with ipu and output
ChatGPT
Certainly! Here are seven coding dictionary questions along with their inputs (ipu) and expected outputs:
Question:
Define a function named reverse_string that takes a string as input and returns the reverse of that string.
Input (ipu):
"hello"
Expected Output:
"olleh"
Question:
Create a function called calculate_average that takes a list of numbers as input and returns the average of those numbers.
Input (ipu):
[10, 20, 30, 40, 50]
Expected Output:
30.0
Question:
Write a function named count_vowels that takes a string as input and returns the count of vowels (a, e, i, o, u) in the string.
Input (ipu):
"programming"
Expected Output:
3
Question:
Define a function called check_palindrome that takes a string as input and returns True if the string is a palindrome; otherwise, returns False.
Input (ipu):
"radar"
Expected Output:
True
Question:
Implement a function named find_max that takes a list of numbers as input and returns the maximum number in the list.