Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

Python Notes

The document provides an overview of basic programming concepts including data types such as float, integer, string, boolean, and list. It explains list operations like pop, remove, append, and insert, as well as control flow statements like if, elif, and else. Additionally, it covers comparison operators and the break statement in programming.

Uploaded by

william-dcosta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Python Notes

The document provides an overview of basic programming concepts including data types such as float, integer, string, boolean, and list. It explains list operations like pop, remove, append, and insert, as well as control flow statements like if, elif, and else. Additionally, it covers comparison operators and the break statement in programming.

Uploaded by

william-dcosta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

LESSON 1

print("any characters exept \") --- writes whatever you want


\n --- new line
float --- decimal number
integer --- regular, non decimal number
string --- any character(s) except \
boolean--- can be set to True or False
list --- ["hi", 0, 1.0, True] --- can store any input. True and False do not
inverted commas unlike string
print(type(...)) --- tells you what data type it is
input(...) --- is the input
int --- makes the input have to be a number

LESSON 2

listVar --- A variable list


listVar.pop() --- removes the last item in the list
listVar.remove() --- removes whatever you specify
listVar.append() --- adds whatever you specify except \ in a string
listVar.insert(num, elem) --- num is the position number (1=0 in python, 1=2 irl),
elem is what you add in that position
print(listVar[:]) --- keeps items until the second number
print(listVar[]) --- only keeps the item number written

LESSON 3

if --- if statement
elif --- short for else if
else --- if something other than the the if occurred
== --- is exactly
!= --- is not
> --- is bigger than
< --- is smaller than
>= --- is bigger than or equal to
<= --- is smaller than or equal to

LESSON 4

break -- whatever written directly after does not occur

You might also like