Skip to contentSkip to navigation

Module 1

Python Basics

Start writing and running clear Python programs with confidence.

// Lessons

5

// Quiz questions

75

// Reading time

75 min

// Exam length

15 Q

// Coding exercises

9

  1. 1Introduction to PythonDiscover Guido van Rossum's design philosophy, the CPython execution model, and Python's core advantages. 15 min 15 questions
  2. 2Your First Python ProgramWrite and run your first script, master console output formatting, quote syntax, and custom separators. 15 min 15 questions
  3. 3Syntax, Indentation & CommentsLearn significant whitespace, block indentation, documentation conventions, and line continuations. 15 min 15 questions
  4. 4Variables & Dynamic TypingUnderstand memory reference tags, dynamic reassignment, multiple assignment, and naming conventions. 15 min 15 questions
  5. 5Core Data Types & Type ConversionWork with integers, floats, strings, booleans, runtime inspection with type(), and explicit type casting. 15 min 15 questions

Coding practice: write it yourself

Real Python, real checks: write your answer, press Run checks, and keep going until it passes. (4 exercises)

All module exercises

Coding practice needs an account. Sign in or create a free ID to run these exercises.

Lab 1: Say hello

Sign-in required

Print exactly Hello, Bangladesh! on one line.

Coding Practice is Locked

Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and earn XP.

Lab 2: Bus tickets

Sign-in required

One Dhaka-to-Gazipur ticket costs 450 taka. Store the price and the number of tickets (3) in variables, then print the total.

Coding Practice is Locked

Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and earn XP.

Lab 3: Student ID line

Sign-in required

Store the name Mim and age 17 in variables, then print them on ONE line separated by a space: Mim 17.

Coding Practice is Locked

Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and earn XP.

Lab 4: Swap two cups

Sign-in required

a holds "tea" and b holds "coffee". Swap their values so printing gives coffee tea.

Coding Practice is Locked

Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and earn XP.

References & Further Reading

Related entries from PyLabs's own reference library.

  • print() (Print objects to the text stream file, separated by sep and followed by end.)
  • input() (Read a line of text typed by a user.)
  • type() (Find out what type of value an object is.)