how are functions defined in python ?
Answer / chaitu
# Defines a "repeat" function that takes 2 arguments.
def repeat(s, exclaim):
"""
Returns the string 's' repeated 3 times.
If exclaim is true, add exclamation marks.
"""
result = s + s + s
if exclaim:
result = result + '!!!'
return result
| Is This Answer Correct ? | 0 Yes | 0 No |
Write a python program to find the second largest number in a list?
What is the output when we execute list(“hello”)?
Write a simple "Hello User" python code snippet.
Write a python program to count the number of digits in a number?
How do you set a global variable inside a function?
Write a python program to check common letters in two input strings?
how are functions defined in python ?
Given a circular list of integers (when you reach the end of the list you come back to the beginning), what is the most efficient algorithm to find the smallest integer in the list? For example: circular_list = [22, 52, 66, 82, 5, 8, 12, 19].
Write a function that takes an array of integers and efficiently calculates and returns the Least Common Multiply in python.
Write a python program to check if a number is a strong number?
Write a program to find sum of the digits of a number in python?
Write a function that takes an integer and returns the smallest number that is greater than the given number which is a palendrome. For example, if the input was 111 the next palindromic number would be 121.