GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Given the following code:numbers = [ 1, 2, 3, 4, 5 ]print (c…

Given the following code:numbers = [ 1, 2, 3, 4, 5 ]print (calculateAverageValue (numbers))def calculateAverageValue (items):   num_items = len (items)   average = 0   total = 0   for item in items:     total = total + item     average = total / num_items   return averageWhat is printed to the screen?

Read Details

A “for” loop can iterate over a list of items in Python.

A “for” loop can iterate over a list of items in Python.

Read Details

Given the following code:data = [ 9.3, 2.6, 1.7, 4 ]Which ex…

Given the following code:data = [ 9.3, 2.6, 1.7, 4 ]Which expression will successfully create a Pandas Series from the data?

Read Details

Given the following code:import numpy as npmy_array = np.arr…

Given the following code:import numpy as npmy_array = np.array ( [10, 20, 30, 40 ] )total = my_array.sum ()What is the value of the following expression:total

Read Details

If the following code is run:movie = “Deadpool and Wolverine…

If the following code is run:movie = “Deadpool and Wolverine”What is the value of the following expression:( movie [0] + movie [8:14] )

Read Details

Given the following code:i = 1c = 0r = range (2, 10, 2)while…

Given the following code:i = 1c = 0r = range (2, 10, 2)while i < len (r): c = c + r [i] i = i + 1What is the value of the following expression:c

Read Details

Part 7 – Advanced Collections

Part 7 – Advanced Collections

Read Details

Part 5 – Collections

Part 5 – Collections

Read Details

Given the following code: burger_price = 5 fries_price = 10…

Given the following code: burger_price = 5 fries_price = 10 drink_price = 5 if (burger_price == fries_price or burger_price == drink_price) and not (fries_price == drink_price):   print(“Price check passed”) else:   print(“Price check failed”) The correct output to the screen is: [BLANK-1]

Read Details

Given the following code:class Employee: def __init__ ( self…

Given the following code:class Employee: def __init__ ( self, name, position = “Intern” ): self.name = name self.position = positionemployee1 = Employee ( “John”, “Manager” )print ( employee1.position )What output is printed to the screen?

Read Details

Posts pagination

Newer posts 1 … 43,526 43,527 43,528 43,529 43,530 … 77,869 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top