Free Online Flashcard Deck

3 Programming Fundamentals Free Online FlashCards

Study 3 Programming Fundamentals with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What is the difference between syntax and semantics?

Back

Syntax is the set of rules for writing valid code; semantics is what correctly written code means when it runs.

02
Front

What is a variable?

Back

A variable is a name associated with a value. Assignment creates or changes that association.

03
Front

Which operator tests equality in Python?

Back

Use `==` to test equality. A single `=` assigns a value to a name.

04
Front

Name five basic Python data values or types.

Back

An integer is a whole number; a float has a fractional part; a string is text; a Boolean is `True` or `False`; `None` represents absence of a value.

05
Front

How does Python conventionally represent a constant?

Back

A constant is a value intended not to change during execution. Python commonly signals this intention with uppercase names, but does not enforce it.

06
Front

What is an expression?

Back

An expression is code that produces or computes a value; it can contain literals, variables, operators, and function calls.

07
Front

What is a statement?

Back

A statement is an instruction that performs an action, such as assigning a value, displaying output, importing a module, or controlling execution.

08
Front

What does indentation organize in Python?

Back

Python uses indentation to show which statements belong to a compound-statement block, such as an `if`, `for`, or `while` block.

09
Front

What type does `input()` return?

Back

`input()` returns the user’s response as a string, even when the response represents a number.

10
Front

What does `print()` do?

Back

`print()` writes values to standard output. Multiple arguments are separated by spaces by default.

11
Front

How does a Python comment work?

Back

A comment begins with `#` and is intended for human readers; Python normally ignores it during execution.

12
Front

What distinguishes a docstring from a `#` comment?

Back

A docstring is a string associated with a function, class, or module for documentation; it is not the same as a regular `#` comment.