+1 (229) 255-3712
glass
pen
clip
papers
heaphones

  

  1. What is the output for the following code?

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

>>> print (len(colors))

2) You wish to perform more advanced calculations through Python. How do you access a math module in Python.

3) Which function is used to get documentation on specific modules, functions, variables, and classes in Python

4) Tuples are mutable. Lists are immutable.

5) Consider the modulus function. What is the output of the following arithmetic? >>> 16%

6) Select which are true for tuples in Python:

  • A tuple is immutable.
  • A tuple is unordered.
  • A tuple is mutable.
  • A tuple remains in the order it is created.

7) Select all the valid string creation phrases for Python: B, C

  1. str1= ‘howdy’
  2. str1= “howdy”
  3. str1= str(“Howdy”)
  4. str1= (howdy)

8) Select all examples of a float:

A. 12.65

B. -10.5

C. -45.23d32

D. 34

9) What is the output for the following code? >>> 6 !=7

10) What is the data type of >>> print (type(10))

11) You decide sleep is for the weak and wish to remove it from your list. How can you accomplish this? [‘camping’, ‘reading’, ‘skiing’, ‘sleeping’, ‘rock climbing']

12) What is the data type of >>> print (type ('Kylo Ren'))

13) What is the output of the following code:

>>> x = 800

>>> y = 75

>>> print(x+y)

14) What is the output of the following code: >>> print(int(9.9999))

15) Which is the correct order of operations?

  1. multiplication, parentheses, exponents, division, subtraction, addition
  2. parentheses, exponents, multiplication, division, addition, subtraction
  3. exponents, parentheses, multiplication, division, subtraction, addition
  4. parentheses, multiplication, exponents, division, addition, subtraction

16) Python file extensions end in what?

17) What is the output of the follow list function?

>>> hobbies = ['camping', 'reading', 'skiing', 'sleeping']

>>> hobbies.append ('rock climbing')

>>> print(hobbies)

18) What is the output of >>> print (12-6*2)

19) What is the correct output of the following code:

>>> greeting = 'Happy'

>>> print(greeting*2)

20) Indices refer to a position within a string or ordered list within Python. With the use of the provided indices, what is the correct output of the following code?

>>> str1= 'PythonForEveryone'

>>> print (str1[0:4], str1[:5], str1[3:-1])

21) What symbol is used to indicate a comment when writing Python code?

22) Which statement(s) is/are true about the ‘for’ loop in Python?

23) What is the data type of the following: >>> PatientDirectory = {1: "Frederick Frankenstein" , 2: "Hans Gruber" , 3: "Albus Dumbledore" , 4: "Izuku Midoria"}

24) Consider the code below. When you run this program, what is the output if the temperature is 77.3 degrees Fahrenheit?

temperature = gloat(input('what is the temperature'))

if temperature >70:

print('Wear short sleeves')

else:

print('bring a jacket')

print ('Go for a walk outside')

25) You decide baking is actually your favorite hobby and wish to add it to the beginning of your list. How would you add baking to your list of hobbies?