Skip to content
← Back to Community
Python Course #2: Data Types
Profile icon
SyrupPY

Python Course #2: Data Types

integers

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

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

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

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:

011010010101
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

That's all for today.

if you hadn't read the last tutorial, go to https://replit.com/talk/learn/PrintingCommenting-Python-Course-1/142824

Voters
Profile icon
HussainTahir
Profile icon
djune
Profile icon
RtoonTV
Profile icon
soren
Profile icon
SyrupPY
Comments
hotnewtop
Profile icon
david0912

Thanks a lot for this posting this. Students can opt for our Finance Assignment Help at an affordable price with zero plagiarism

Profile icon
RtoonTV

It is not really in depth though it is good and thank you for your time and effort gone into making this tutorial

Profile icon
SyrupPY

@RtoonTV
No prob. :)

Profile icon
SyrupPY

@RtoonTV
Ooopsies I hit a wrong button

Profile icon
RtoonTV

@SyrupPY
What wrong button lol

Profile icon
SyrupPY

@RtoonTV
I hit the delete button but good thing I copied my words so that even if i hit da delete i would still paste then it's still good az new

Profile icon
RtoonTV

thanks

Profile icon
IMayBeMe

Maybe add a more in depth explanation of how data types are interpreted to a computer. For example booleans are the basis for computers as they can represent 1s and 0s also known as boolean logic.