Mastery09 – Basic types and their use in python

the basic types of data that python works with are:

1.- Integer: these are whole numbers from negative to positive, they can be used in the program simply writing the number in the program like 45 and to turn an input into an integer write int before the input.

2.- Float: floats are numbers with decimals like 2.5, to turn an integer into float just write float before it.

3.- strings: a set of letters, number or other characters, these dont hold any value appart from the character itself, a  number written as a string wont be counted as a numeric value. strings are between ” ” to differentiate them.

4.- Tuples: a list with a fixed number of elements, they are use ( ).

5.- List: a list without a fixed number of elements, they use [ ].

6.- Dictionaries: a list of multiple elements that can be adressed by text, they use { }.

reference:

http://en.wikiversity.org/wiki/Python/Basic_data_types

CC BY 4.0 Mastery09 – Basic types and their use in python by sergio is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.