0% found this document useful (0 votes)
5 views1 page

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)
5 views1 page

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

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