Python Fundamentals Flashcards

1
Q

The ______ of a language is the the format the code must be typed or written in in order for the interpreter to successfully run or a compiler to succesfully build and execute.

A

Syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The / [Forwardslash] character is used to extend statements to a new line in python.

A

False. It is the backslash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You are programming in Python and the interpreter gives you the following error.
TabError: inconsistent use of tabs and spaces in indentation.
What is the first thing you need to check for in your code?

A

Verify your code contains no illegal mixing of tabs and spaces.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Python relies heavily on ________ to determine the control flow structure of an application.

A

indentation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the recommended shebang convention to ensure that Python scripts can continue to be portable across Linux systems, regardless of the version of the Python interpreter. (PEP 394)

A

!/usr/bin/env python3

Even as the Python 2 interpreter becomes less common, it remains reasonable for scripts to continue to use the python3 convention, rather than just python. (from PEP 394)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The shebang in a Python text file provides what to the script?

A

The pathway to the Python interpreter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

An _________ is the name applied to software that can edit,organize and debug code.

A

IDE (refer to slide deck 1 slide 25 and, 26)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly