Function Assignments
Write a program to create a function which take your name and greet you.
Write a program to take two values and print the sum using function.
Write a Python program to print the multiplication table of a given number(using functions).
Write a python program to create a function area_of_square(side) and calculate the area of square through taking input from user.
Write a program to create a function to calculate the area of rectangle and the function must return the value.
Write a program to receive three integers from keyboard and get their sum and product calculated through a user-defined function cal_sum_prod().
Write a python program to find the sum of all the even numbers between the range of
start
andend
using functions.
Write a python program to check if the given number is even or odd using functions.
Pangram is a sentence that uses every letter of the alphabet. Write a program that checks whether a given string is pangram or not, through a user-defined function ispangram()
Write a python program to get the reverse of the string using functions.
Write a python program that accepts a hypen-separated sequence of words as input and calls a function convert() which converts it into a hypen-separated sequence after sorting them alphabetically. For example, if the input string is 'here-come-the-dots-followed-by-dashes' then the converted string should be by-come-dashes-dots-followed-here-the
Write a python function to create and return a list containing tuples of the form (x, x^2, x^3) for all x between 1 and 20(both included).
A palindrome is a word or phrase which reads the same in both directions. Given below are some palindromic strings: deed level Malayalam Rats live on no evil star Murder for a jar of red rum
Write a program that defines a function ispalindrome() which checks whether a given string is a palindrome or not. Ignore spaces and case mismatch while checking for palindrome.
Write a program that defines a function convert() that receives a string containing a sequence of whitespace separated words and returns a string after removing all duplicate words and sorting them alphnumerically. For example if the string passed to convert() is s = 'Sakhi was a singer because her mother was a singer, and Sakhi\'s mother was a singer because her father was a singer'. then, the output should be : Sakhi Sakhi's and because father her mother singer singer, was
Write a program that defines a function count_alphabets_digits() that accepts a string and calculates the number of alphabets and digits in it. It should return these values as a dictionary. Call this function for some sample strings.
Write a program that defines a function called frequency() which computes the frequency of words present in a string passed to it. The frequencies should be returned in sorted order by words in the string.
Write a Python program to find the factorial of a number using functions.
Write a python program to check whether the number is prime or not using functions.
Write a Python program to count the number of vowels in a string.
Write a Python function to find the sum of the digits of a given number.
Write a python program to take multiple number of variables but the number of arguments are not fixed they may vary and calculate the sum of those numbers. It is provided that the values passed must be numbers.
Write a Python program that takes a list of numbers as input and outputs the range of the list (i.e. the difference between the largest and smallest values).
Write a Python function that takes a list of numbers as input and returns a new list containing only the even numbers from the input list.
Write a Python function that takes a list of strings as input and returns a new list containing only the strings that start with the letter 'A'.
Write a Python function that takes a list of numbers as input and returns the average of all the numbers in the list.
Last updated