TechCC

Login to access your student portal

Don't have an account? Register

Welcome!

This course is designed to teach you the fundamentals of Python in a hands-on, interactive way.

You will go through several chapters, each containing:

Your progress and score will be tracked at the top. Let's get started!

1. Introduction

Python is a simple, powerful programming language. Its main command for displaying output is print().

You can also add comments to your code using the hash symbol (#). Comments are notes for humans that the computer ignores.

Example 1.1

Playground: Hello World

Click "Run Code" to see the output, you can tweak below code to print your own name.

    

Example 1.2

Playground: Simple Calculation


    

Question 1.1

What is the command to display text on the screen?

Question 1.2

Which symbol starts a comment in Python?

2. Variables & Data

Variables store data. Python has types like integers (int), floats (float), strings (str), and Booleans (bool). No explicit declaration is neededβ€”just assign a value. Use type() to check a variable's type.

Example 2.1

Playground: Assigning Variables


    

Example 2.2

Playground: Checking Types


    

Question 2.1

Which of these is NOT a standard Python data type?

Question 2.2

What will type(10) return?

3. Strings

Strings are sequences of characters for storing text. You can join them (concatenate) and use methods for formatting, like changing case. Strings are immutable, meaning they can’t be changed; operations on them create new strings.

Example 3.1

Playground: Concatenation


    

Example 3.2

Playground: f-Strings


    

Question 3.1

Select the method to convert a string to uppercase.

message = "hello"
print(message.)

Question 3.2

Which operator joins two strings?

"Hello" "World"

4. Operators

Operators perform operations. Python has arithmetic (`+`, `-`, `*`, `/`), comparison (`==`, `!=`, `>`, `<`), and logical (`and`, `or`, `not`) operators. They help perform math, compare values, and build complex conditions to control program flow.

Example 4.1

Playground: Arithmetic


    

Example 4.2

Playground: Logic


    

Question 4.1

Fill in the blank to check if a is NOT equal to b.

a = 5
b = 10
print(a  b)

Question 4.2

What is the output of 10 ** 2?


        
    

5. Conditionals

Conditionals let programs make decisions. if checks if a condition is true. elif tests more conditions. else runs if nothing before it was true. This helps your program behave differently based on various situations.

Example 5.1

Playground: if-else


    

Example 5.2

Playground: if-elif-else


    

Question 5.1

Fill in the blank to check if the temperature is warm.

temperature = 25
 temperature > 20:
    print("It's warm.")

Question 5.2

Fill in the blank to classify a score of 85.

score = 85
if score >= 90:
    print("Grade A")
 score >= 80:
    print("Grade B")
else:
    print("Grade C")

6. Loops

Loops repeat actions. `for` loops iterate over a sequence (like a list or range). `while` loops run as long as a condition is true. `break` exits a loop, and `continue` skips the current iteration. Loops are essential for automation.

Example 6.1

Playground: for loop


    

Example 6.2

Playground: while loop


    

Question 6.1

Complete the `for` loop to print numbers from 0 to 4.

 i in range(5):
    print(i)

Question 6.2

Fill in the blank to make the `while` loop stop after 3 iterations.

count = 0
while count < :
    print("Looping...")
    count += 1

7. Lists & Tuples

Lists and tuples store multiple items. Lists are mutable (changeable), created with `[]`. Tuples are immutable (unchangeable), created with `()`. Both can hold mixed data types and be indexed. Use lists for flexible collections, and tuples for fixed data.

Example 7.1

Playground: Lists


    

Example 7.2

Playground: Tuples


    

Question 7.1

Fill in the blank to add "orange" to the list.

fruits = ["apple", "banana"]
fruits.("orange")
print(fruits)

Question 7.2

How do you access the first item in a list?

fruits = ["apple", "banana"]
print(fruits[])

8. Functions

Functions group reusable code into named blocks using `def`. They can take arguments and return results with `return`. Functions keep code organized, readable, and prevent repetition (DRY - Don't Repeat Yourself).

Example 8.1

Playground: Basic Function


    

Example 8.2

Playground: Function with Return


    

Question 8.1

Use the `def` keyword to define a function.

 say_hello():
    print("Hello!")
say_hello()

Question 8.2

Complete the function to return the sum.

def sum_two(x, y):
     x + y

print(sum_two(10, 20))

Final Task

Write a Python program to determine a grade based on marks.
Your code should:

The correct output for `marks = 85` should be "Grade B".


        
    

πŸŽ‰ Course Completed! πŸŽ‰

Congratulations! Enter your name below to generate your certificate.

Certificate of Completion

This certifies that

Your Name Here

has successfully completed the course conducted by Robo Mentors, demonstrating dedication, consistent effort, and a strong understanding of the essential concepts and practical applications covered throughout the program.

Interactive Python Course

Verify completion at

ID:

Issued

CEO Name

for