Practice Test: Python Programming Write a Python function to calculate the factorial of a given positive integer
Question:
Practice Test: Python Programming
Write a Python function to calculate the factorial of a given positive integer n. The factorial of n is the product of all positive integers less than or equal to n.
Given a list of numbers, write a Python function to find and return the sum of all even numbers in the list.
Create a Python class called Rectangle with attributes width and height. Add methods to calculate the area and perimeter of the rectangle.
Write a Python function that takes a string as input and returns a new string with all vowels removed.
Given a list of integers, write a Python function to find the largest and smallest numbers in the list.
Create a Python function that takes two arguments, a and b, and returns their greatest common divisor (GCD). Use the Euclidean algorithm to find the GCD.
Write a Python function that takes a list of words as input and returns a new list containing only the words with three or more vowels.
Implement a Python function to check if a given number is a prime number. Return True if it's prime, otherwise False.
Write a Python function that takes a list of numbers as input and returns a new list with the elements in reverse order.
Create a Python class called Student with attributes name, age, and grades (a list of integers). Add methods to calculate the average grade and return a string representation of the student.
Java How To Program Early Objects
ISBN: 9780134743356
11th Edition
Authors: Paul Deitel, Harvey Deitel