Immerse yourself in the dynamic world of Python 3 with these carefully crafted practice questions. Dive in, code, and master this versatile language, step by step.

Python 3's simplicity and efficiency make it a top choice for beginner and experienced programmers alike. Here, we present a mix of beginner-friendly and intermediate-level problems to help you gain a solid grasp of Python 3.

Control Flow
Let's start with control flow. Python 3 offers if-elif-else statements and loops (for and while) to control the flow of your program.

Mastering control flow is crucial as it allows you to execute code based on specific conditions and repeat tasks.
Conditional Statements

Let's say you want to categorize numbers into 'even' and 'odd'. Write a program that takes an integer as input and outputs 'Even' or 'Odd' accordingly.
For example, if the input is 4, the output should be: Even.
Loops

Now, let's create a program that prints the multiplication table (up to 10) of a given number.
The output for '5' should look like this:
5 x 1 = 5 5 x 2 = 10 ... 5 x 10 = 50
Data Structures

Python 3 provides various built-in data structures like lists, tuples, sets, and dictionaries. Let's explore them.
Data structures enable us to store, manage, and manipulate data efficiently.



















Lists
Can you write a program that reverses a given list in Python 3? For example, if the input is [1, 2, 3, 4, 5], the output should be [5, 4, 3, 2, 1].
Bonus: Try to accomplish this without using the slicing method.
Dictionaries
Write a Python 3 script that counts the frequency of characters in a given string. The output should be in dictionary format. For instance, if the input is 'hello world', the output should be {'h': 1, 'e': 1, 'l': 2, 'o': 2, 'w': 1, 'r': 1, 'd': 1}.
Functions and Modules
Functions and modules are the backbone of Python programming. They allow you to reuse code and keep your code modular.
Let's create and import functions.
Functions
Can you define a Python 3 function that calculates the factorial of a given number using recursion?
For example, if the input is 5, the output should be 120 (because 5 * 4 * 3 * 2 * 1 = 120).
Modules
Suppose you want to import a function from a custom module named 'utils'. In the module, you have a function:
# utils.py def greet(name): return f'Hello, {name}'
To use this function in another program, what steps do you need to follow?
Keep practicing and exploring Python 3, and don't forget to check out the official documentation for more concepts and examples. Good luck with your coding journey!