Which four data types are used in Python? Can you give an example of each?

In Python we use Strings, Integers, Floats and Booleans.String - text e.g. "Hello World"Integer - whole number e.g. 5Float - decimal number e.g. 2.8Boolean - binary value e.g. True, False

ES

Related Python Mentoring answers

All answers ▸

What are docstrings and how do I use them to improve my code readability?


When to use a dectionary or a list


How does a for loop work in Python?


Manually implement a function that finds the smallest value in a list of integers and print it.