Profile icon
SyrupPY

# Python Course #2: Data Types.css-1q3m8ps{margin-left:var(--space-4);margin-right:var(--space-4);display:none;}

## integers.css-1q3m8ps{margin-left:var(--space-4);margin-right:var(--space-4);display:none;}

You probably know about numbers. Numbers are integers like 5, 728, -98, -193 etc. Numbers are data types. A int is a integer/number.

## floats.css-1q3m8ps{margin-left:var(--space-4);margin-right:var(--space-4);display:none;}

A float has a decimal point: 54.34 and -76.2. Floats are decimals. Floats are useful for trying to figuring out pi (3.14159265359). It's also useful for exact numbers. If you wanted to express the number between 3 and 4, you would want to write "3.5". Sorry fraction users, fractions are not used in python calculation, but you could convert decimals into fractions.

## strings.css-1q3m8ps{margin-left:var(--space-4);margin-right:var(--space-4);display:none;}

str are "strings". Strings are words.
123abc is considered a str. As long as a data type has a word/letter, then it would be considered a string. Periods, Commas, Hyphens, Brackets, and etc. are all strings. You use strings all the time to communicate.

## booleans.css-1q3m8ps{margin-left:var(--space-4);margin-right:var(--space-4);display:none;}

True and False are the only booleans. True is basically "yes", while False is "no". Booleans are used to answer questions such as Is 5 more than 2? if it is, then you would reply "True!", else reply "False".
Booleans are also 0s and 1s. Computers send information using 0s and 1s. In a picture 0 could mean white and 1 could mean black:

0110
1001
0101
except for the 0s and 1s are all in one line:

`.css-19sk4h4{position:relative;}.css-1bu6gr6{-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-width:0;border-style:solid;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;outline:none;min-height:0;min-width:0;position:relative;}.css-1n2m10r{padding:var(--space-8);border-radius:var(--border-radius-4);background-color:var(--background-higher);}.css-1hwur6u{-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-width:0;border-style:solid;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;outline:none;min-height:0;min-width:0;padding:var(--space-8);border-radius:var(--border-radius-4);background-color:var(--background-higher);}.css-1svvr0w{height:0;}.css-rk73ff{padding:var(--space-4);padding-left:var(--space-4);padding-right:var(--space-2);font-family:var(--font-family-code);font-size:14px;line-height:var(--line-height-small);overflow-x:auto;tab-size:2;word-break:break-word;white-space:break-spaces;overflow-wrap:anywhere;}`011010010101``
```.css-19sk4h4{position:relative;}.css-1bu6gr6{-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-width:0;border-style:solid;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;outline:none;min-height:0;min-width:0;position:relative;}.css-1n2m10r{padding:var(--space-8);border-radius:var(--border-radius-4);background-color:var(--background-higher);}.css-1hwur6u{-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-width:0;border-style:solid;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;outline:none;min-height:0;min-width:0;padding:var(--space-8);border-radius:var(--border-radius-4);background-color:var(--background-higher);}.css-1svvr0w{height:0;}.css-rk73ff{padding:var(--space-4);padding-left:var(--space-4);padding-right:var(--space-2);font-family:var(--font-family-code);font-size:14px;line-height:var(--line-height-small);overflow-x:auto;tab-size:2;word-break:break-word;white-space:break-spaces;overflow-wrap:anywhere;}```To represent numbers, computers use base ten:
Our Numbers:   Binary Code:
0              0
1              1
2              10
3              11
4              100
5              101
6              110
7              111
8              1000
9              1001
10             1010``````