0% found this document useful (0 votes)
2 views

Python Assignment 2

https://visionarycaregroup.co.uk/
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Python Assignment 2

https://visionarycaregroup.co.uk/
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment#2 (Python Functions)

Question 1: Write a function called is_even that takes an integer as a parameter and returns True if
the number is even, and False if it’s odd.

Question 2: Create a function called calculate_bmi that takes two parameters: weight (in kg) and
height (in meters), and returns the BMI (Body Mass Index) using the formula:

Question 3: Write a function called fibonacci that takes a single integer n and returns a list of the first
n numbers in the Fibonacci sequence.

Question 4: Write a function called factorial that takes an integer n and returns the factorial of that
number using recursion.

Question 5: Write a function find_max_min that takes a list of numbers as input and returns a tuple
containing the maximum and minimum numbers in the list.

You might also like