Computer Flashcards
Computer 9 (Text)
print(“Computer 9”);
5 (Value)
print(5);
5 (Text)
print(“5”);
Escape sequence; Newline
“\n”
Computer 9 (A new line after)
print(“Computer 9 \n”);
The three data types
Text, integer, float
thing (variable, text data type)
thing = “ “
thing (variable, integer or float data type)
thing = 0
Show “name (variable, text data type)” = “input” (Use the words: INPUT YOUR NAME: )
name = input(“INPUT YOUR NAME: “);
Show “num (variable, integer data type)” = “input” (Use the words: INPUT NUMBER: )
num = int(input(“INPUT NUMBER: “));
Show “num (variable, float data type)” = “input” (Use the words: INPUT NUMBER: )
num = float(input(“INPUT NUMBER: “));
Addition
+
Subtraction
-
Multiplication
*
Division
/
Modulus
%
Equal
==
Not Equal
!=
Greater than
>
Less than
<
Greater than or
equal to
> =
Less than or equal to
<=
Returns True if both statements are true
and
Returns True if one of the statements is true
or