Data types, variables, basic input-output operations, basic operators Flashcards
What is a function able to do?
- cause some effect
- evaluate a value and return it as the functions result
What is the function invocation?
The function name along with parentheses and arguments
What happens when python encounters an invocation? e.g. funct_name(argument)
- check if the name if legal
- check if function requirements for arguments allows you to invoke the function in this way
- leaves your code and jumps into function you want to invoke
- executes code, causes desired effect
- returns to your code
Does python allow more than one instruction in a line?
No
How do you create a new line in python?
\n
What is the escape character?
\
What are the two ways of passing arguements?
Positional way and keyword arguments
What are they elements and one rule for the keyword argument?
Elements = keyword, equal sign and value
Rule = have to be put after the last positional argument
What are the two keyword arguments for print?
end and sep
What is a positional argument?
Ones whose meaning is dictated by their position
What is a keyword argument?
Ones whose meaning is not dictated by their location, but by a special word (keyword) used to identify them
What is a literal?
A literal is data whose values are determined by the literal itself.
How are numbers handle by computers?
Integers (no fractional part)
Floating point numbers
What is the numeric type?
The characteristic of the numeric value which determines its kind, range, and application
What is the prefix for octal numbers?
0o (zero - o)