Physics I / Data representation and basic types
Practice question · True or false

In Python, the string '42' and the integer 42 are the same type.

Hints
  1. Quotation marks change what the value is, not just how it looks.
  2. Ask whether the two could be compared numerically without conversion.
Show the answer

False

Why

'42' is a str; 42 is an int. They must be converted to compare numerically.

Read the lesson: Data representation and basic types →

Practise Data representation and basic types

The app has 8 more questions on this lesson, and keeps your place in the course. Physics I is free to start.

More questions on Data representation and basic types