PCEP Module 2: Introduction to Python and Computer Programming Flashcards
the fundamentals of computer programming, i.e., how the computer works, how the program is executed, how the programming language is defined and constructed; the difference between compilation and interpretation; what Python is, how it is positioned among other programming languages, and what distinguishes the different versions of Python. (9 cards)
What does the print() function do in Python?
It shows a message or output on the screen.
What are two things a function can do?
Make something happen. 2) Return a value.
What are the three types of functions in Python?
1) Built-in functions
2) Functions from modules
3) Functions you create yourself
True or False — A Python function can take any number of arguments, including none.
True
Besides the name, what else is important in a function?
The arguments — they’re the inputs the function uses.
What should you think about when naming a function?
The name should describe what the function does.
What do Python functions always need?
Parentheses () — even if there are no arguments.
How do you run a function with arguments?
Put the arguments inside the parentheses.
True or False — You must use parentheses even if there are no arguments.
True