You are on page 1of 3

Python 1

2 feb

Today in class we discussed about 4 data types:

INTEGERS – represent the whole numbers, negatives and positives,


but without a floating point (or coma in Romanian numbering
system)

!VERY IMPORTANT!

When we are writing in Python we use “.” NOT “,” as our delimiter
for the decimals.

EX: 2, 25, -7, 0, -3, 9

FLOATS - represents the positive and negative floating point numbers


+ THE WHOLE NUMBERS.

And probably the question is: Why do we need integers when we


have floats. It is because of memory. Integers take less memory than
Floats.

EX: 2.5, 35.0, -2.1, -20.3

STRINGS – represents every character or sequence of characters.


We write strings using ‘ ’ or “ ”

VERY IMPORTANT!
Numbers can also be strings, like “5” or ‘-6’

Also 5 is different form ‘5’ or “5”, because the first one is an integer
and the other two are strings.
EX: “homework”, ‘python’, “I’m cool”, ‘67’

List – represents a sequence of data types, like integers, floats or


strings. We write strings using []

VERY IMPORTANT!

There can also be empty lists like: []

Also, a list can have other lists inside: [[2,3], 3, ‘string’]

EX: [“homework”, ‘python’, 67, -9.5]

For defining a variable we just use a name for the variable and then
put ‘=’ and the value, like the example below
For writing in Python we use Pycharm. First, we open it and create a
project.

Make sure that you have selected Virtualenv and for base
interpreter something with python 3.9 or 3.10. After, then just press
create.

You might also like