Basics Flashcards
Comments
( # ) comment
Addition, multiplication, subtraction, division
( + * - / )
Less than, less than or equal, more than, more than or equal
( >= )
Defining variables numbers
NAME = NUMBER
Defining variables object
NAME = ‘ VARIABLE’
Formatter numbers
“STUFF and %d” % variable
Formatting variables
“STUFF and %s” % variable
Formatting more than one variable
“STUFF and %s and %d” % ( variables in order they appear )
Printing
Print “STUFF”
Formatting in a string
“STUFF and %r” = A
Print A % variable
Repeat printing
“STUFF” * no. of times wanting to repeat
What does a comma do at the end of a print followed by another print
It makes the following print on the same line as the one with the comma
Difference between %r and %s
%r is used for debugging, %s is used for displaying
How to print a sting with “ or ‘ in
You use “”” STUFF “””
How to insert a backslash
( \ )