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 ▸

Write a short program to print all the even numbers 1 to 100


How would you get a piece of code to print the numbers 1 to 10


Write a program that takes a value x and then outputs x Fibonnaci numbers. E.g. if x=6 output would be 1 1 2 3 5 8


Describe both For-loops and While-loops and explain how you can simulate the effect of a for loop with a while loop with an example.