Python Flashcards
Python is used for ______
web development (server-side),
software development,
system scripting
Indentation refers to the _____ at the beginning of a code line.
spaces
the indentation in Python is very important.
The number of spaces is up to you as a programmer, the most common use is ___, but it has to be at least one.
four
You have to use the ________ in the same block of code, otherwise Python will give you an error:
same number of spaces
In Python, variables are created when you ______
assign a value to it.
Comments start with a ___
#
Python does not really have a syntax for _______ comments.
multiline
You can use ________ string as multiline comment
multiline string (triple quotes)
“ “ “This
is multiline comment “ “ “
You can get the data type of a variable with the____function.
type()
y = “John”
print(type(y))
Variable names are _______
case-sensitive. (‘a’ is different than “A”)
A variable name must start with a __________
letter or the underscore character
A variable name cannot start with a _______
number
A variable name can only contain ____________
alpha-numeric characters and underscores
Multi Words Variable Names
Variable names with more than one word can be difficult to read.
There are several techniques you can use to make them more readable:
Camel Case (Each word, except the first, starts with a capital letter:) - myVariableName = “John”
Pascal Case (Each word starts with a capital letter:) -MyVariableName = “John”
Snake Case (Each word is separated by an underscore character:) - my_variable_name = “John”
Python _____ function is often used to output variables.
print()