Topic 7 Flashcards

1
Q

How is the development of python maintained?

A

Though the use of PEPs

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

The python philosophy is contained within which PEP?

A

Number 20

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

Which import module will display the Zen/philosophy of python?

A

import this

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

Which IDE ships by default with python?

A

IDLE

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

Which key combination will exit the Python shell when accessed through the terminal in a Linux environment?

  1. ) Alt + X
  2. ) Ctrl +D
  3. ) Ctrl + F6
  4. ) Alt +F12
A

Ctrl+D

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

Which characteristics describe the Python programming language?

  1. ) It is a compiled language
  2. ) It is an open source language
  3. ) It is an assembly language
  4. ) It is an interpreted language.
A

It is an open source language.

It is an interpreted language.

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

Under which menu item will you find commands for “Dedent Region” and “Untabify Region” in IDLE?

  1. ) Edit
  2. ) Format
  3. ) Options
  4. ) Windows
A

Format

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

What command and format is required to display the help information for any function?

A

help(input)

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

In what format does the input function read in user input?

  1. ) String
  2. ) Boolean
  3. ) Array
  4. ) Object
A

String

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

By default, how many spaces are code suites indented when using the Python IDLE?

  1. ) 3
  2. ) 4
  3. ) 2
  4. ) 5
A

4

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

Explain what is meant by the use of this operator.

x**y

A

This is an exponent. In other words, x raised to the power of y

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

What type of variable will x be?

x = 5.

A

float

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

How many instances are there in the Boolean class?

A

Two

Either True of False

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

In relation to the Boolean class, zero values are considered to have what value?

A

False

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

Which statement accurately describes the bool class?

  1. ) Boolean Or returns the first False or the last True value
  2. ) Boolean Not returns False if the operand is True
  3. ) Zero values are considered True
  4. ) The bool class is a subclass of the array class
A

Boolean Not returns False if the operand is True

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

What data type is now represented by int in Python 3?

  1. ) Float
  2. ) Short
  3. ) Decimal
  4. ) Long
A

Long

17
Q

Which statement will correctly assign x as an infinite number?

x = infinity
x = int('inf')
x = float('inf')
x = pos_infinity
A

x = float(‘inf’)