This is a draft cheat sheet. It is a work in progress and is not finished yet.
Math Symbol
== |
equal to |
!= |
not equal to |
>= |
More than or Equal to |
<= |
Less than or Equal to |
* |
Multiply |
** |
Exponent |
/ |
Divide (float,decimal) |
// |
Divide (interger) |
% |
Find the remainder (Modulo) |
Addition , Multiplication and Exponents
String + String |
Combine together |
String + Number |
Fail |
Number + Number |
Plus |
String * Number |
Combine that string (string..string) |
String * String |
Fail |
Number * Number |
Multiply |
String ** String |
Fail |
Number ** Number |
Exponent |
String ** Number |
Fail |
Vocab.
String |
A list of character such as number, letter and symbols |
Integer |
whole number |
Floating |
Decimal |
Boolean |
True/False |
|
|
Function
print() |
Displays information on the screen |
input() |
Receive information from user |
int() |
Converts value to integer |
str() |
Converts value to string |
float() |
Converts value to decimal point |
# |
Comment |
"" / """ |
Multi-line comment |
len() |
The length of string |
Example
Firstname = |
input("What is your first name?") |
Lastname = |
input("What is your last name?") |
Fullname = |
(firstname +" "+ lastname) |
print |
(fullname) |
name = |
input ("please enter your name;") |
surname = |
input ("please enter your surname;") |
print |
("Welcome to Computer Science" + name, surname[0]) |
|
|
|