Full Access Locked
You are viewing this roadmap in Preview Mode. Upgrade your membership to unlock all missions.
Your Journey
0 / 112 MissionsPython Intro – What is CPython?
<p> In this lesson, you won’t write code yet. Instead, you will learn about Python and the most common implementation called CPython. </p> <pre> Expected Output Example: - Understand what CPython is - Know why it is widely used </pre> <p> This challenge will help you understand Python's underlying implementation and environment. </p>
Python Syntax – Writing Your First Python Code
<p> Write a Python script that prints a simple message. Practice Python’s syntax rules including indentation and statements. </p> <pre> Expected Output Example: Hello, Python! </pre> <p> This challenge will help you understand basic Python syntax and how to run simple scripts. </p>
Python Comments – Documenting Your Code
<p> Write a Python script that prints a message and includes comments to explain the code. Practice both single-line and multi-line comments. </p> <pre> Expected Output Example: Hello, Python! </pre> <p> This challenge will help you learn how to document your Python code effectively. </p>
Python Variables – Storing Data
<p> Create a Python script that declares variables to store your name, age, and favorite color, then print them to the screen. </p> <pre> Expected Output Example: Name: Akram Age: 21 Favorite Color: Blue </pre> <p> This challenge will help you practice declaring and using variables in Python. </p>
Python Variable Names – Rules and Best Practices
<p> Create Python variables following proper naming rules. Try to declare a few variables using valid names and print them. </p> <pre> Expected Output Example: user_name: Alice userAge: 25 favorite_color: Blue </pre> <p> This challenge will help you understand the rules and best practices for naming variables in Python. </p>
Python Assign Multiple Values – Assigning Multiple Variables at Once
<p> Create a Python script where you assign multiple values to multiple variables in a single line, then print all the variables. </p> <pre> Expected Output Example: x: 5 y: 10 z: 15 </pre> <p> This challenge will help you practice assigning values efficiently in Python. </p>
Python Output Variables – Displaying Values
<p> Create a Python script that declares some variables and prints their values in different ways: separately, combined in one line, and with custom separators. </p> <pre> Expected Output Example: Name: Akram Age: 21 Favorite Color: Blue </pre> <p> This challenge will help you practice using the <code>print()</code> function effectively with variables. </p>
Global Variables – Accessing Variables Across Functions
<p> Create a Python script that uses a global variable. Modify its value inside a function and print it both inside and outside the function. </p> <pre> Expected Output Example: Inside function: 10 Outside function: 10 </pre> <p> This challenge will help you understand how global variables work in Python. </p>
Python Data Types – Introduction
<p> Create Python variables of different data types such as integers, floats, strings, and booleans. Print the type of each variable using the <code>type()</code> function. </p> <pre> Expected Output Example: 10 <class 'int'> 3.14 <class 'float'> Hello <class 'str'> True <class 'bool'> </pre> <p> This challenge will help you understand Python’s core data types and how to identify them. </p>
Python Numbers – Integers and Floats
<p> Create Python variables to store integer and float numbers. Perform basic arithmetic operations like addition, subtraction, multiplication, and division, and print the results. </p> <pre> Expected Output Example: 10 + 5 = 15 10 - 5 = 5 10 * 5 = 50 10 / 5 = 2.0 </pre> <p> This challenge will help you practice working with numbers in Python. </p>
Strings: Basic
Print 'Hi'
Multiline Strings
Print a 3-line string
Strings as Arrays
Print first char of 'Hello'
Slicing Strings
Slice 'Hello' from index 2 to 4
Negative Slicing
Slice 'Hello' from -4 to -1
String Length
Print length of 'ABC'
Check String
Check 'free' in 'The best things are free'
Modify Strings
Lowercase 'HELLO'
Replace String
Replace 'H' with 'J' in 'Hello'
Split String
Split 'A,B' by comma
String Format
Format age=36: 'I am 36'
Escape Characters
Print 'Line1 Line2'
Booleans
Print 10 > 9
Bool Function
Print bool('Hello')
Arithmetic Operators
Print 10 % 3
Assignment Operators
+=
Comparison Operators
Print 5 == 5
Logical Operators
Print True and False
Identity Operators
Check if [1] is [1]
Python Lists
Create list [1, 2] and print
Access List Items
Print 2nd item of [10, 20]
Change List Item
Change [1, 2] to [1, 3]
Add List Items
Append 3 to [1, 2]
Remove List Items
Pop last item of [1, 2]
Loop Lists
Print each item in [1, 2]
List Comprehension
Create [0, 1, 2] with range
Sort Lists
Sort [3, 1, 2]
Copy Lists
Copy list l=[1]
Join Lists
Join [1] and [2]
Python Tuples
Create tuple (1, 2)
Access Tuple
Print 1st item of (10, 20)
Update Tuples
Change (1, 2) to (1, 3)
Unpack Tuples
Unpack (1, 2) into a, b
Loop Tuples
Print each in (1, 2)
Join Tuples
Join (1,) and (2,)
Tuple Methods
Count 1 in (1, 1, 2)
Python Sets
Create set {1, 2}
Add Set Items
Add 3 to {1, 2}
Remove Set Items
Remove 1 from {1, 2}
Python Dictionaries
Create {'a':1}
Access Dict Items
Get value of 'a'
Change Dict Items
Change 'a' to 2
Add Dict Items
Add 'b':2
Remove Dict Items
Pop 'a'
Loop Dictionaries
Loop keys of {'a':1}
Copy Dictionaries
Copy {'a':1}
Nested Dictionaries
Create {'p':{'id':1}}
Dictionary Methods
Update {'a':1} with {'b':2}
If ... Else
Print 'Yes' if 1 < 2
Elif
Print 'B' if x=2 else 'A'
Else
Print 'E' if x=3 else 'F'
Short Hand If
a=2; b=1; if a>b: print('OK')
Short Hand If Else
Print 'A' if 1>2 else 'B'
And / Or
Check 1<2 and 2<3
Nested If
Nested check x > 10
While Loop
Print 1 to 3 with while
While Break
Break while if i==3
While Continue
Skip i==3 in while
For Loop
Print 1, 2 from list
For Break
Break for if x==2
For Continue
Skip 2 in for
Range Function
Print range(3)
Functions
Define hello() and call it
Arguments
Func with name 'Bob'
*args
Sum arbitrary args
Keyword Arguments
Func with k1, k2
**kwargs
Print child name from kwargs
Default Parameter
Print default 'US'
Return Values
Return x * 5
Lambda
Lambda x: x + 10
Lambda Multiplication
Multiply 5, 6 with lambda
Classes/Objects
Class MyClass with x=5
__init__()
Class Person with name
The self Parameter
Method that prints self.n
Inheritance
Class Student(Person)
super()
Call parent __init__
Iterators
Iterate over list
Scope
Local x in func
Global Keyword
Global x in func
Modules
Import math and print pi
Math Module
sqrt(64)
JSON to Python
Parse '{"a":1}'
Python to JSON
Dump {'a':1}
Try Except
Try 1/0
Try Finally
Print 'Done' in finally
User Input
Mock input (simulated)
String Formatting
Format 'Price: {:.2f}'
File Open
Explain modes (r, a, w, x)
RegEx
Find 'ai' in 'Rain in Spain'
List sort reverse
Sort [1, 3, 2] desc
Dict update
Update {'a':1}
Set intersection
Intersection of {1, 2}, {2, 3}
Map function
Square [1, 2]
Filter function
Filter >1 from [1, 2]
Set union
Union of {1}, {2}
Dict keys
Get keys of {'a':1}
String isdigit
Check '123'
List index
Find 'a' in ['b', 'a']
Math pow
Print pow(4, 3)
Math ceil
Ceil 1.4
Math floor
Floor 1.4
Path Completion
Complete all missions to earn your certificate of mastery.