22.Programming Assignment 5 ( using functions)
Now you can write the following programs using simple functions
1.Write a function big(a,b) which will print the biggest of two number.
2.Write a python function to find the area of a circle.( university question)
3.Write a program asks users for the temperature in Fahrenheit (F) and prints the temperature in Celsius. (Conversion: Celsius = (F - 32) * 5/9.0). Use a function convert which takes one argument F and returns C.
4. Write a Python function, odd, that takes in one number and returns True when the number is odd and False otherwise.
5. Write a Python function, fourthPower( ), that takes in one number and returns that value raised to the fourth power.
6.Write a menu driven Python program to simulate a calculator with addition, subtraction, multiplication, division and exponentiation. Use separate function to implement each operation.( university question)
7.Write a program to compute nCr, using a factorial function.(university question)
8.Write a Python program to calculate the area of a circle, given the center and a point on the perimeter. Use a function to find the radius as the distance between two points.(university question)
9. Write a function to find the sum of numbers between a lower bound and an upper bound.( university question)
10.Write a Python program using function to check the type of a triangle(scalene, isosceles, equilateral) by getting the vertices from the user.( university question)
11.Find the binary equivalent of each digit of a number(ie;BCD each digit is represented as 4 bit binary). Use a separate function to find binary.
12.Write a menu driven program to calculate area of a circle, triangle,rectangle and square.Use separate function to implement each operation.( University question)
13.Write a program to display a multiplication table of size nxn for any given 'n' using function.( university question)
14.Write two functions isdigit(), which returns true if the character passed is a digit and isletter() ,which return true if the character passed is a letter.( university question).
15.Write a program that reads an integer N from the keyboard and then calls a user defined function to compute and displays the sum of numbers from N to 2N if N is non-negative. If N is negative display the sum from 2N to N. The starting and end points are included in the sum.(university question)
16.Write a python function that will accept three arguments x,y and z.Find x+y and if the sum is greater than z, return the square root of (x^2+y^2), otherwise return -1.(university question)
17.Find the sum of the cosine series 1-x^2/2!+x^4/4!-x^6/6!......n terms.Use a function fact to find the factorial of the number( university question).
18.Write a Python function is_prime(n), which returns True if the number n is a prime and returns False, if the number n is not prime.Use the is_prime(n) function to generate first N prime numbers.(university question)
19.Write a python function to generate first N Fibonacci numbers and return as a list.(university question)
20.Write a python function digit() to extract digit of a number. Check whether all the digits are even.
1.Write a function big(a,b) which will print the biggest of two number.
2.Write a python function to find the area of a circle.( university question)
3.Write a program asks users for the temperature in Fahrenheit (F) and prints the temperature in Celsius. (Conversion: Celsius = (F - 32) * 5/9.0). Use a function convert which takes one argument F and returns C.
4. Write a Python function, odd, that takes in one number and returns True when the number is odd and False otherwise.
5. Write a Python function, fourthPower( ), that takes in one number and returns that value raised to the fourth power.
6.Write a menu driven Python program to simulate a calculator with addition, subtraction, multiplication, division and exponentiation. Use separate function to implement each operation.( university question)
7.Write a program to compute nCr, using a factorial function.(university question)
8.Write a Python program to calculate the area of a circle, given the center and a point on the perimeter. Use a function to find the radius as the distance between two points.(university question)
9. Write a function to find the sum of numbers between a lower bound and an upper bound.( university question)
10.Write a Python program using function to check the type of a triangle(scalene, isosceles, equilateral) by getting the vertices from the user.( university question)
11.Find the binary equivalent of each digit of a number(ie;BCD each digit is represented as 4 bit binary). Use a separate function to find binary.
12.Write a menu driven program to calculate area of a circle, triangle,rectangle and square.Use separate function to implement each operation.( University question)
13.Write a program to display a multiplication table of size nxn for any given 'n' using function.( university question)
14.Write two functions isdigit(), which returns true if the character passed is a digit and isletter() ,which return true if the character passed is a letter.( university question).
15.Write a program that reads an integer N from the keyboard and then calls a user defined function to compute and displays the sum of numbers from N to 2N if N is non-negative. If N is negative display the sum from 2N to N. The starting and end points are included in the sum.(university question)
16.Write a python function that will accept three arguments x,y and z.Find x+y and if the sum is greater than z, return the square root of (x^2+y^2), otherwise return -1.(university question)
17.Find the sum of the cosine series 1-x^2/2!+x^4/4!-x^6/6!......n terms.Use a function fact to find the factorial of the number( university question).
18.Write a Python function is_prime(n), which returns True if the number n is a prime and returns False, if the number n is not prime.Use the is_prime(n) function to generate first N prime numbers.(university question)
19.Write a python function to generate first N Fibonacci numbers and return as a list.(university question)
20.Write a python function digit() to extract digit of a number. Check whether all the digits are even.
21.Find the sum of the sin series x-x^3/3!+x^5/5!...n
22.Find the sum of the series( e^x) 1+x/1!+x^2/2!+x^3/3!+x^4/4!....n
Comments
Post a Comment