1. Write a function called say_hello that prints "Hello, World!" when called.

  2. Define a function print_triangle that prints the following pattern:

    *
    * *
    * * *
    * * * *
    * * * * *
    
    
  3. Write a function even_or_odd that takes no parameters, prompts the user to enter a number, and then prints whether the entered number is even or odd.

  4. Create a function is_leap_year that takes no parameters and asks the user to enter a year. The function should then determine whether the entered year is a leap year and print the result.

Function practice question arguments

  1. Write a function greet_user that asks the user for their name and then prints a personalized greeting using that name.
  2. Write a function calculate_rectangle_area that takes two arguments: length and width, and returns the area of a rectangle. Test the function with different values.
  3. Write a function calculate_factorial that takes a non-negative integer n as an argument and returns the factorial of n.
  4. Write a function filter_even_numbers that takes a list of integers as an argument and returns a new list containing only the even numbers.

Function practice question for return statement

  1. Create a function reverse_string that takes a string as an argument and returns the reverse of that string.
  2. Create a function count_occurrences that takes a list and an element as arguments and returns the number of times the element appears in the list.
  3. Write a function is_vowel that takes a character (a single letter) as an argument and returns True if it's a vowel (either uppercase or lowercase), and False otherwise.

Lambda Function practice question

  1. Create a lambda function to filter even numbers from a list of integers.
  2. Write a lambda function that takes an integer as an argument and returns True if it's even and False if it's odd.
  3. Given a list of numbers, use map to square each element in the list and return the result as a new list.
  4. Given a list of strings, use filter to select only the strings that contain the letter 'a'