Learn to Code via Tutorials on Repl.it!

← Back to all posts
Python Course #2: Data Types
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:

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
RtoonTV
SorenAtReplit
SyrupPY
Comments
hotnewtop
david0912

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

RtoonTV

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

SyrupPY

@RtoonTV No prob. :)

SyrupPY

@RtoonTV Ooopsies I hit a wrong button

RtoonTV

@SyrupPY What wrong button lol

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

RtoonTV

thanks

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.