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

Beginner Python Functions Assignment

Uploaded by

Qisa Fatima
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)
7 views1 page

Beginner Python Functions Assignment

Uploaded by

Qisa Fatima
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

Beginner Python Assignment – Functions

Q1. Write a function called greet() that prints 'Hello, welcome to Python!'. Call the function two times.

Q2. Create a function add_numbers(a, b) that returns the sum of two numbers. Call the function and
print the result.

Q3. Write a function find_max(a, b) that returns the larger number. Test it with two different inputs.

Q4. Create a function square(num) that returns the square of a number. Ask the user for a number and
pass it to the function.

Q5. Write a function print_table(n) that prints the multiplication table of any number from 1 to 10. Call
the function with a number of your choice.

You might also like