week2_1

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

20 Terms

1
New cards
What is Python?
Python is a dynamically typed, interpreted programming language that emphasizes simplicity and readability.
2
New cards
What does it mean for Python to be dynamically typed?
In Python, the type of a variable is defined at runtime and does not need to be specified upon declaration.
3
New cards
How does Python differ from statically typed languages?
In statically typed languages, the variable's type must be specified at declaration, whereas Python does not require this.
4
New cards
What does 'interpreted' mean in the context of Python?
Python code is run directly by an interpreter line by line instead of being compiled into machine code.
5
New cards
What are primitive constructs in programming languages?
Primitive constructs are the basic building blocks of programming languages, such as numbers, strings, and operators.
6
New cards
What is an example of invalid syntax in Python?
A sentence in Python that does not follow the correct structure, such as 'noun noun noun', would result in invalid syntax.
7
New cards
What is the meaning of semantics in programming?
Semantics refers to the meaning of expressions and how they are interpreted by the programming language.
8
New cards
What are syntactic errors?
Errors that occur due to incorrect structure or syntax, such as misspelled words or incorrect indentation.
9
New cards
What are semantic errors?
Errors that occur when the code is syntactically correct but logical mistakes are present, such as using a variable before it is defined.
10
New cards
What is a variable in Python?
A variable is a name that refers to a value and is assigned using the assignment operator '='.
11
New cards
What are the naming conventions for variables in Python?
Variable names should be short but descriptive, lowercase with underscores for separation, and constants should be in all uppercase letters.
12
New cards
What is a Boolean expression?
A Boolean expression is an expression that evaluates to either True or False.
13
New cards
What do logical operators do in Python?
Logical operators such as 'and', 'or', and 'not' are used to combine or modify Boolean expressions.
14
New cards
What is an if-statement in Python?
An if-statement allows the execution of code based on whether a specified condition evaluates to True.
15
New cards
What is a function in Python?
A function is a reusable piece of code that can take arguments, perform a task, and return a value.
16
New cards
What is the purpose of the return keyword?
The return keyword is used to send a result back from a function to the caller.
17
New cards
What does it mean to define a function in Python?
Defining a function creates a new function that can be called later in the code to execute the defined actions.
18
New cards
What is the difference between scalar and non-scalar objects in Python?
Scalar objects are indivisible values like integers; non-scalar objects can hold multiple values like lists or dictionaries.
19
New cards
What is type casting in Python?
Type casting is converting an object from one type to another, like converting a float to an int.
20
New cards
What is a comment in Python?
Comments are notes in the code that are ignored by the Python interpreter, used to make the code more understandable.