|
float()
|
change to number with decimal
|
|
integer()
|
change to number with NO decimal
|
|
Boolean = True/False
|
True/False
|
|
print()
|
display the information on the screen
|
|
input()
|
ask for some information from the users
|
|
len()
|
length of the string
|
|
# abcd
|
single line comment
|
|
"""abcd"""
|
multi-line comments
|
|
+ Addition
|
== equal to
|
|
- Subtraction
|
!= not equal to
|
|
* Multiplication
|
< less than
|
|
/ Division
|
> more than
|
|
** To the power of
|
<= less than or equal to
|
|
% Modulo
|
>= more than or equal to
|
|
print()
|
display data on the screen
|
|
"....."
|
use quotation mark to make it as a string
|
|
string placement
|
1st letter = 0
|
|
print multi variables
|
use comma
|
|
blank space counts as a character
|
len can be used for STRING ONLY
|
|
upper
|
capital letter; upper()
|
|
lower
|
small letter; lower()
|
|
EX:
|
x = "hello897"
|
|
y = x.upper()
|
|
|
print (y) = "HELLO897"
|
|
concatenation
|
joining multiple strings together
|
|
Ex:
|
phrase = "Task" + "is" + "balding"
|
|
print (phrase) >>>> Taskisbalding
|
|
|
If you enter spaces or gaps
|
Ex: phrase = "Task " + "is " + "balding"
|
|
print (phrase)>>>> Task is balding
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.