Programming FundamentalsNot Started
Data Types
Integers, floats, strings, booleans, lists, dicts, and more
0%
Knowledge0%
Learn & DrillFluency0%
Drill & SpeedRetention0%
Mastery & ReviewConfidence0%
All modesKnowledge
Fluency
Retention
Knowledge Debt detected
You can study this freely — but your score may plateau if these foundations have gaps. The Mastery badge requires them to be solid.
Explanation
Python has several built-in data types. The most common are:
print(type(42))
print(type(3.14))
print(type("hello"))What will this print?
Numbers
int— whole numbers, e.g.42,-7float— decimal numbers, e.g.3.14,-0.5
Strings
- Text wrapped in single or double quotes:
"hello",'world'
Booleans
TrueorFalse— used in conditions
Lists
- Ordered, collections:
[1, 2, 3]
Dictionaries
- pairs:
{"name": "Alice", "age": 30}
Tuples
- Ordered, immutable collections:
(1, 2, 3)
None
- Represents the absence of a value
Use type(x) to check the type of any value.
Examples
Common types
Different data types in Python
age = 25 # int
price = 9.99 # float
name = "Bob" # str
active = True # bool
scores = [95, 87] # list
info = {"city": "NY"} # dict
print(type(age)) # <class 'int'>How well did you understand this?
Next in Programming Fundamentals
Functions