RecallTutor

Now learning Programming

Common data types

Now studying "Common data types".

Tutor

Python has several built-in data types. The most common are `int`, `float`, `str`, and `bool`. Can you give me an example of each?

int is 5, float is 3.14, str is "hello", bool is True.

Tutor

Exactly right. Here's the tricky part — in Python 3, what does `5 / 2` return, and why does that surprise beginners?

It returns 2.5, a float — beginners expect the integer 2.

Tutor

Bingo. Division always returns a float in Python 3. Can you think of a real task where this behavior would surprise you?

Sign up