Computer Science
Name the built-in mathematical function/method:
(a) Used to return an absolute value of a number.
(b) Used to return the value of xy, where x and y are numeric expressions.
(c) Used to return a positive value of the expression in float.
Python Functions
1 Like
Answer
(a) abs()
(b) pow(x, y)
(c) math.fabs()
Answered By
2 Likes
Related Questions
Write a function countNow(PLACES) in Python, that takes the dictionary, PLACES as an argument and displays the names (in uppercase) of the places whose names are longer than 5 characters. For example, Consider the following dictionary:
PLACES = {1: "Delhi", 2: "London", 3: "Paris", 4: "New York", 5:"Doha"}
The output should be:
LONDON
NEW YORKWrite a program using user-defined function to calculate and display average of all the elements in a user-defined tuple containing numbers.
Name the built-in String function:
(a) Used to remove the space(s) from the left of the string.
(b) Used to check if the string is uppercase or not.
(c) Used to check if the string contains only whitespace characters or not.
Write a function LeftShift(lst, x) in Python which accepts numbers in a list (lst) and all the elements of the list should be shifted to left according to the value of x.
Sample Input Data of the list lst = [20, 40, 60, 30, 10, 50, 90, 80, 45, 29] where x = 3
Output lst = [30, 10, 50, 90, 80, 45, 29, 20, 40, 60]