Example
Type Conversion
Changing data types using int(), float() and str() functions. Converting between types.
Showing 1–10 of 73
Example
Changing data types using int(), float() and str() functions. Converting between types.
Quiz
Free beginner quiz on Python type conversion and input(): 15 questions on int(), float(), str(), bool() and reading numbers from the user.
Challenge
…says what it returns and what the reserve means, then add type hints for its parameters and return value; the tests read both from the function itself.
Quiz
Free beginner quiz on Python data types: 15 questions on int, float, str, bool, None, lists, tuples, dictionaries and sets, with instant answers.
Example
Python recognizes different data types automatically. Learn int, float, str and bool.
Article Python Fundamentals
Learn Python variables and data types - the building blocks of programming. Discover how to store numbers, text, and complex data structures effectively while following best practices for clean and…
Challenge
…and text that only looks like numbers. Predict what type() shows, find the values that need converting, then convert a packet yourself.
Quiz
…Python variables: 15 questions on naming, assignment, data types, type conversion and scope, with instant answers.
Challenge
…out the crew after the next docking. Whatever number you type, it crashes. Predict what happens, find out why input() is behind it, fix it, then write a packing tool that reads two numbers. Predict…
Challenge
A status line crashes with a TypeError because it joins text and a number with +. Predict it, read the error, fix it with str(), then build a docking status line.