Youโ€™re the Expert!

pynfinity

Code Playground

Chapter 1

What is Programming? ๐Ÿค–

Programming is giving step-by-step instructions to a computer. Like a recipe for a robot โ€” it follows your orders exactly!

๐Ÿค–

Click a command to instruction the robot:

# Each button = one instruction
robot.wave()

You just programmed a robot! Every button is an instruction.

Chapter 2

Variables & Memory ๐Ÿ“ฆ

A variable is like a labeled box in the computer's memory. Give it a name, store a value โ€” then use it anytime!

๐Ÿ‘† Click a value chip, then click a box to store it!

42 "Alice" True 3.14 "Python"
age?0x7f01
name?0x7f02
ready?0x7f03
age = ?
name = ?
ready = ?
Chapter 3

Data Types ๐ŸŽจ

Every piece of data has a type. The type tells the computer what kind of info it's handling. Click each type to explore!

๐Ÿ”ข
Integer
42, -7, 0
๐ŸŒŠ
Float
3.14, 0.5
๐Ÿ“
String
"Hello!"
โœ…
Boolean
True/False
๐Ÿ“‹
List
[1, 2, 3]
๐Ÿ—‚๏ธ
Dictionary
{"key":"val"}
๐Ÿ‘† Click a type card to see details!
Chapter 4

Operators โž• The Math Magic

Operators are symbols that perform actions on data โ€” like a calculator but way more powerful! Click to see them in action.

+
Add
-
Subtract
*
Multiply
/
Divide
%
Modulo
**
Power
==
Equal
!=
Not Equal
>
Greater
<
Less
and
Logical AND
or
Logical OR
๐Ÿ‘† Click an operator card to see how it works
Chapter 5

How Code Runs โš™๏ธ

A compiler or interpreter translates your human-readable code into instructions the machine understands โ€” like a real-time translator!

๐Ÿ“
Your Code
โ†’
๐Ÿ”
Lexer
โ†’
๐ŸŒณ
Parser
โ†’
๐Ÿ”ง
Compiler
โ†’
๐Ÿ’ป
Machine
Output will appear hereโ€ฆ
Compiler

Translates ALL code at once before running (C, Java, Go)

Interpreter

Reads & runs code line by line (Python, JavaScript, Ruby)

Chapter 6

Conditions: if / else ๐Ÿ”€

Programs make decisions! Like a fork in the road โ€” if something is true, take one path; otherwise, take another.

Is it raining?
No โ˜€๏ธ
โ˜‚๏ธ
if raining:
if raining == True:
  print("Take umbrella!")
๐Ÿ˜Ž
else:
else:
  print("Enjoy sunshine!")
if

Check condition

elif

Else-if (chain)

else

Otherwise

Chapter 7

Loops: Repeat! ๐Ÿ”„

Why write the same thing 100 times when a loop does it for you? Loops repeat actions automatically โ€” like a merry-go-round!

for i in range(0):
  print("Star โญ", i)
Count: 0
for loop

Repeat a fixed number of times

for i in range(5):
  print(i)
while loop

Repeat while condition is True

while x > 0:
  x = x - 1
Chapter 8

Functions: Magic Machines ๐ŸŽฐ

A function is like a vending machine โ€” put something in (input), get something useful out (output). Define it once, use it forever!

def double(x):
  return x * 2

Pick an input to feed the machine:

?
โ†’
โš™๏ธ double(x)
โ†’
?
Parameters

Variables inside the function (x is a parameter)

Return

What the function sends back as its output

Chapter 9

Classes & Objects ๐Ÿ—๏ธ

A class is a blueprint โ€” like a cookie cutter. You use it to stamp out many objects, each with the same structure but different data!

๐Ÿพ class Pet:
name species sound

def speak(self): print(self.sound)

Chapter 10

Algorithms: The Recipe ๐Ÿ“‹

An algorithm is a step-by-step recipe to solve a problem. Every program is built on algorithms โ€” from Google Search to your phone's GPS!

Algorithm: Make a Cup of Tea โ˜•

1
Boil water to 100ยฐC
2
Place teabag in cup
3
Pour hot water into cup
4
Wait 3 minutes (loop: check every 30s)
5
If strong enough โ†’ remove teabag
6
Add milk/sugar? (condition)
7
โ˜• Return the finished tea!
Input

Data the algorithm starts with

Process

Steps to transform the data

Output

Result the algorithm produces

Chapter 11

Bugs & Debugging ๐Ÿ›

A bug is a mistake in code. Debugging is the detective work of finding and fixing it. Every programmer debugs โ€” it's a superpower, not a failure!

Can you spot the bug? Click the broken line to fix it!

Syntax Error

Typo or wrong grammar (missing colon, bracket)

Logic Error

Code runs but gives wrong answer

Runtime Error

Crashes while running (divide by zero, etc.)

Chapter 12

Flashcards: Know the Terms ๐Ÿƒ

Master the vocabulary every programmer uses daily. Click the card to flip and reveal the definition!

๐Ÿ’พ
Loading...
๐Ÿ‘† Click to flip
1 / 20
Chapter 13

Quiz: Test Your Knowledge! ๐Ÿง 

You've learned so much! Let's put it to the test. Answer 10 questions and see your score!

Loading question...
Score: 0 / 0
Chapter 14

Language Quick Start ๐Ÿš€

Pick a language and get your first code running! All languages share the same core concepts โ€” just different syntax.

Python โ€” The best first language! Clean, readable, used in AI, web, and science. Install: python.org
Hello World
print("Hello, World!")
Variables
name = "Alice"
age = 20
is_happy = True
If / Else
if age >= 18:
    print("Adult")
else:
    print("Minor")
For Loop
for i in range(5):
    print(i)
Function
def greet(name):
    return "Hi, " + name

print(greet("Bob"))
List
fruits = ["apple","banana"]
fruits.append("cherry")
print(fruits[0])  # apple
Dictionary
person = {
    "name": "Alice",
    "age": 20
}
print(person["name"])
Class
class Dog:
    def __init__(self, name):
        self.name = name
    def bark(self):
        print("Woof!")

d = Dog("Rex")
d.bark()
๐Ÿ›ฃ๏ธ Your Python path: Variables โ†’ Data Types โ†’ Conditions โ†’ Loops โ†’ Functions โ†’ Classes โ†’ Libraries (numpy, pandas, flask) โ†’ Projects!
JavaScript โ€” The language of the web! Runs in every browser. No install needed โ€” open DevTools (F12) and start typing!
Hello World
console.log("Hello, World!");
Variables
let name = "Alice";
const age = 20;
let isHappy = true;
If / Else
if (age >= 18) {
  console.log("Adult");
} else {
  console.log("Minor");
}
For Loop
for (let i = 0; i < 5; i++) {
  console.log(i);
}
Function
function greet(name) {
  return "Hi, " + name;
}
console.log(greet("Bob"));
Array
let fruits = ["apple","banana"];
fruits.push("cherry");
console.log(fruits[0]); // apple
Object
let person = {
  name: "Alice",
  age: 20
};
console.log(person.name);
Class
class Dog {
  constructor(name) {
    this.name = name;
  }
  bark() { console.log("Woof!"); }
}
let d = new Dog("Rex");
d.bark();
๐Ÿ›ฃ๏ธ Your JS path: Basics โ†’ DOM Manipulation โ†’ Events โ†’ Fetch/API โ†’ Node.js โ†’ React/Vue โ†’ Full-stack Projects!
Java โ€” Powerful, runs everywhere. Used in Android apps, enterprise software. Install JDK from oracle.com
Hello World
public class Main {
  public static void main(String[] args) {
    System.out.println("Hello!");
  }
}
Variables
String name = "Alice";
int age = 20;
boolean happy = true;
If / Else
if (age >= 18) {
  System.out.println("Adult");
} else {
  System.out.println("Minor");
}
For Loop
for (int i = 0; i < 5; i++) {
  System.out.println(i);
}
Method
static String greet(String n) {
  return "Hi, " + n;
}
ArrayList
ArrayList<String> list =
  new ArrayList<>();
list.add("apple");
System.out.println(list.get(0));
Class
class Dog {
  String name;
  Dog(String n) { name = n; }
  void bark() {
    System.out.println("Woof!");
  }
}
Key Rule
// Java is strongly typed!
// Every variable needs a type:
int x = 5;       // int
double y = 3.14; // decimal
String s = "hi"; // text
๐Ÿ›ฃ๏ธ Your Java path: Basics โ†’ OOP โ†’ Collections โ†’ Exceptions โ†’ File I/O โ†’ Threads โ†’ Android/Spring Boot!
C++ โ€” Blazing fast! Used in games, OS, embedded systems. Install: MinGW (Windows) or g++ (Linux/Mac)
Hello World
#include <iostream>
using namespace std;
int main() {
  cout << "Hello!" << endl;
  return 0;
}
Variables
string name = "Alice";
int age = 20;
bool happy = true;
double pi = 3.14;
If / Else
if (age >= 18) {
  cout << "Adult";
} else {
  cout << "Minor";
}
For Loop
for (int i = 0; i < 5; i++) {
  cout << i << endl;
}
Function
string greet(string n) {
  return "Hi, " + n;
}
cout << greet("Bob");
Vector (List)
vector<string> fruits;
fruits.push_back("apple");
cout << fruits[0];
Class
class Dog {
public:
  string name;
  void bark() {
    cout << "Woof!";
  }
};
Key Rule
// Compile then run!
// Every program needs main()
// Return 0 = success
๐Ÿ›ฃ๏ธ Your C++ path: Basics โ†’ Pointers โ†’ OOP โ†’ STL โ†’ Memory Management โ†’ Game Dev / System Programming!

๐ŸŽ‰ You're a Coder Now!

You've learned every foundational concept in programming. Every app, game & website is built with these ideas. Now go build something amazing!

๐Ÿ”ข Variables โœ“ ๐ŸŽจ Data Types โœ“ ๐Ÿ”€ Conditions โœ“ ๐Ÿ”„ Loops โœ“ ๐ŸŽฐ Functions โœ“ ๐Ÿ—๏ธ Classes โœ“
๐Ÿ“š Explore Courses


Pynfinity
Install Pynfinity Add to home screen for the best experience