The python ________ is a program that can read python programming statements and execute them.

Python Statement

Instructions that a Python interpreter can execute are called statements. For example, a = 1 is an assignment statement. if statement, for statement, while statement, etc. are other kinds of statements which will be discussed later.

Multi-line statement

In Python, the end of a statement is marked by a newline character. But we can make a statement extend over multiple lines with the line continuation character (\). For example:

a = 1 + 2 + 3 + \
    4 + 5 + 6 + \
    7 + 8 + 9

This is an explicit line continuation. In Python, line continuation is implied inside parentheses ( ), brackets [ ], and braces { }. For instance, we can implement the above multi-line statement as:

a = (1 + 2 + 3 +
    4 + 5 + 6 +
    7 + 8 + 9)

Here, the surrounding parentheses ( ) do the line continuation implicitly. Same is the case with [ ] and { }. For example:

colors = ['red',
          'blue',
          'green']

We can also put multiple statements in a single line using semicolons, as follows:

a = 1; b = 2; c = 3

Python Indentation

Most of the programming languages like C, C++, and Java use braces { } to define a block of code. Python, however, uses indentation.

A code block (body of a function, loop, etc.) starts with indentation and ends with the first unindented line. The amount of indentation is up to you, but it must be consistent throughout that block.

Generally, four whitespaces are used for indentation and are preferred over tabs. Here is an example.

for i in range(1,11):
    print(i)
    if i == 5:
        break

The enforcement of indentation in Python makes the code look neat and clean. This results in Python programs that look similar and consistent.

Indentation can be ignored in line continuation, but it's always a good idea to indent. It makes the code more readable. For example:

if True:
    print('Hello')
    a = 5

and

if True: print('Hello'); a = 5

both are valid and do the same thing, but the former style is clearer.

Incorrect indentation will result in IndentationError.


Comments are very important while writing a program. They describe what is going on inside a program, so that a person looking at the source code does not have a hard time figuring it out.

You might forget the key details of the program you just wrote in a month's time. So taking the time to explain these concepts in the form of comments is always fruitful.

In Python, we use the hash (#) symbol to start writing a comment.

It extends up to the newline character. Comments are for programmers to better understand a program. Python Interpreter ignores comments.

#This is a comment
#print out Hello
print('Hello')

We can have comments that extend up to multiple lines. One way is to use the hash(#) symbol at the beginning of each line. For example:

#This is a long comment
#and it extends
#to multiple lines

Another way of doing this is to use triple quotes, either ''' or """.

These triple quotes are generally used for multi-line strings. But they can be used as a multi-line comment as well. Unless they are not docstrings, they do not generate any extra code.

"""This is also a
perfect example of
multi-line comments"""

To learn more about comments, visit Python Comments.


Docstrings in Python

A docstring is short for documentation string.

Python docstrings (documentation strings) are the string literals that appear right after the definition of a function, method, class, or module.

Triple quotes are used while writing docstrings. For example:

def double(num):
    """Function to double the value"""
    return 2*num

Docstrings appear right after the definition of a function, class, or a module. This separates docstrings from multiline comments using triple quotes.

The docstrings are associated with the object as their __doc__ attribute.

So, we can access the docstrings of the above function with the following lines of code:

def double(num):
    """Function to double the value"""
    return 2*num
print(double.__doc__)

Output

Function to double the value

To learn more about docstrings in Python, visit Python Docstrings.

Home >> Assignments >> Other >> QUESTION 1The Python __________ is a program that can read Pythonprogramming statements and execute

(Solved): QUESTION 1The Python __________ is a program that can read Pythonprogramming statements and execute ...



QUESTION 1

  1. The Python __________ is a program that can read Pythonprogramming statements and execute them.

8 points   

QUESTION 2

  1. "In __________ mode, the interpreter reads the contents of afile that contains Python statements and executes eachstatement."

8 points   

QUESTION 3

  1. "A(n) __________ character is a special character that ispreceded with a backslash (), appearing inside a stringliteral."

8 points   

QUESTION 4

  1. The __________ specifier is a special set of characters thatspecify how a value should be formatted.

8 points   

QUESTION 5

  1. A(n) __________ statement will execute one block of statementsif its condition is true or another block if its condition isfalse.

8 points   

QUESTION 6

  1. "Python provides a special version of a decision structure knownas the __________ statement, which makes the logic of the nesteddecision structure simpler to write."

8 points   

QUESTION 7

  1. The logical __________ operator reverses the truth of a Booleanexpression.

8 points   

QUESTION 8

  1. Boolean variables are commonly used as __________ to indicatewhether a specific condition exists.

8 points   

QUESTION 9

  1. A(n) ___________ expression is made up of two or more Booleanexpressions.

8 points   

QUESTION 10

  1. The turtle.isdown() function returns ___________ if the turtle'spen is down.

8 points   

QUESTION 11

  1. "In Python, you would use the __________ statement to write acount-controlled loop."

8 points   

QUESTION 12

  1. A(n) __________ total is a sum of numbers that accumulates witheach iteration of the loop.

8 points   

QUESTION 13

  1. A(n) __________ is a special value that marks the end of asequence of items.

8 points   

QUESTION 14

  1. The acronym __________ refers to the fact that the computercannot tell the difference between good data and bad data.

8 points   

QUESTION 15

  1. The ___________ chart is an effective tool used by programmersto design and document functions.

8 points   

QUESTION 16

  1. The 'P' in the acronym IPO refers to ___________.

8 points   

QUESTION 17

  1. "In Python, a module's file name should end in ___________."

8 points   

QUESTION 18

  1. "The approach known as __________ makes a program easier tounderstand, test, and maintain."

8 points   

QUESTION 19

  1. The return values of the trigonometric functions in Python arein __________.

8 points   

QUESTION 20

  1. "A filename __________ is a short sequence of characters thatappear at the end of a filename, preceded by a period."

8 points   

QUESTION 21

  1. A(n) __________ gives information about the line number(s) thatcaused an exception.

8 points   

QUESTION 22

  1. A(n) ___________ block includes one or more statements that canpotentially raise an exception.

8 points   

QUESTION 23

  1. The __________ method reverses the order of the items in alist.

8 points   

QUESTION 24

  1. The __________ function returns the item that has the lowestvalue in the sequence.

8 points   

QUESTION 25

  1. The __________ package is a library you can use in Python tocreate two-dimensional charts and graphs.

Get Expert Solution


Answer to QUESTION 1 The Python __________ is a program that can read Python programming statements and execute them. 8 points QUE...

The python ________ is a program that can read python programming statements and execute them.

Why Place An Order With Us?

  • Certified Editors
  • 24/7 Customer Support
  • Profesional Research
  • Easy to Use System Interface
  • Student Friendly Pricing

Order Now

What best describes Python as a programming language?

Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. It supports multiple programming paradigms beyond object-oriented programming, such as procedural and functional programming.

What is statement and its types in Python?

There are mainly four types of statements in Python, print statements, Assignment statements, Conditional statements, Looping statements. The print and assignment statements are commonly used. The result of a print statement is a value.

What kind of programming language is Python quizlet?

Python is an example of what type of programming language? General purpose scripting language.

What is Python quizlet?

interpreter. computer program that simulates the behavior of a computer that understands a high-level language; executes the lines of source one by one and carries out the operations (Python is an interpreted language) source code. the text of a program in a high-level language. machine code.