Skip to Content
Course content

Hands-on coding challenges

1. Introduction to Python

  1. Print "Hello, Python!" to the console.
  2. Check the Python version installed on your system using a script.

2. Python Basics

  1. Write a program that accepts a user's name and greets them with "Hello, [name]!".
  2. Write a program to calculate the sum of two numbers entered by the user.

3. Working with Data Structures

Lists

  1. Create a list of 5 numbers and print the sum of all the numbers in the list.

Tuples

  1. Write a program to create a tuple with elements from 1 to 5 and print the third element.

Dictionaries

  1. Create a dictionary with keys as names and values as ages. Print all names (keys) in the dictionary.

Sets

  1. Write a program to find the intersection of two sets.

4. Functions and Modules

  1. Write a function to calculate the factorial of a given number.
  2. Import the math module and use it to calculate the square root of 64.

5. Object-Oriented Programming (OOP)

Classes and Objects

  1. Create a Car class with attributes make and model, and a method display_info() that prints them.

Inheritance

  1. Create a Dog class that inherits from an Animal class and overrides a method.

6. File Handling

  1. Write a program to create a text file and write "Hello, File!" into it.
  2. Write a program to read and print the contents of the text file created above.

7. Error and Exception Handling

  1. Write a program to handle a ZeroDivisionError exception.

8. Python for Data Analysis

NumPy

  1. Create a NumPy array of numbers from 1 to 5 and calculate the mean.

Pandas

  1. Create a Pandas DataFrame with columns Name and Age and print it.

9. Advanced Topics in Python

Generators

  1. Create a generator to yield numbers from 1 to 3.

Regular Expressions

  1. Write a regex to find all email addresses in a string.

10. Working with APIs

Making API Requests

  1. Use the requests library to fetch data from an API (e.g., https://jsonplaceholder.typicode.com/todos/1).

Parsing JSON Responses

  1. Parse the JSON response to print the title of the fetched data.

This list of challenges ensures hands-on experience across core Python topics.

Commenting is not enabled on this course.