PYTHON FUNCTIONS ASSIGNMENT
Course: Basics of Programming
Unit: Functions
Marks: 35
Name: ____________________
Roll No.: ____________________
Class: ____________________
Date: ____________________
Part A: Concept + Analysis (10 Marks)
Q1. Explain the difference between Local and Global variables, and functions with return vs
without return (with examples).
Q2. Trace the output:
def func(x):
x = x + 10
return x
a=5
print(func(a))
print(a)
Q3. Explain default and keyword arguments with examples.
Part B: Intermediate Programming (10 Marks)
Q4. Function to find largest and smallest number in a list.
Q5. Function to count even and odd numbers in a list.
Q6. Function to count vowels and consonants in a string.
Part C: Advanced Programming (15 Marks)
Q7. Function to check palindrome number.
Q8. Function to find sum of digits (without built-in functions).
Q9. Function to generate Fibonacci series.
Bonus
Check palindrome string without slicing.
Instructions
- Show logic and sample input/output
- Maintain proper indentation
- Avoid shortcuts where not allowed