Cheatography
https://cheatography.com
Python Function
print() |
Display an information on the screen |
int() |
Change number to an integer |
float() |
Change number to an decimal number |
input() |
Ask for the information from the user |
str() |
A list of number, letter and symbols |
len() |
Length of the string |
# |
Comment |
|
|
Python Operations
== |
equal to |
!= |
no equal to |
< |
less than |
> |
more than |
<= |
less than or equal |
% |
calculate for remainder |
+ |
add |
- |
substract |
* |
multiplication |
/ |
division |
** |
exponent |
|
|
Example
Print (2) – integer
Print (2.5) – floating point
Print (“Hello”) – string
Print (mystr) – variable
Print (mystr,”Hi”,2,1.0) -- commas
mystr = “Hi”
mystr ← name
“Hi” ← value can change
|
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment