GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Assuming the user provides 49 as input, what is the output o…

Assuming the user provides 49 as input, what is the output of the following code snippet? x = 0 y = int( input(“enter a y!”) )  if y > 50 :      x = y print( “x: ” + str(x) )

Read Details

What can be used as an argument in a function call? A varia…

What can be used as an argument in a function call? A variable An expression Another function call that returns a value Another function call that has no return value

Read Details

Suppose we have the following array: data = [ 4, 6, 9, 10, 1…

Suppose we have the following array: data = [ 4, 6, 9, 10, 1, 94 ] Select ALL statement(s) that will display entry 94 from the array shown.

Read Details

Consider the following code snippet. Assuming that the user…

Consider the following code snippet. Assuming that the user inputs 75 as the age, what is the output? age = 0age = int( input(“Please enter your age: “) )if age < 10:    print("Child")if age < 30:    print("Young adult")if age < 70:    print("Old ")if age < 100:    print("Impressively old")

Read Details

In an accounting application, you discover several places wh…

In an accounting application, you discover several places where the total profit, a double value, is calculated. Which of the following should be done to improve the program design? The next time the total profit is calculated, use copy and paste to avoid making coding errors. Provide the same comment every time you repeat the total profit calculation. Consider writing a helper function that returns the total profit as a float value.

Read Details

Which code snippet will result in the variable total holding…

Which code snippet will result in the variable total holding the sum of the first n even numbers? Note: including n Note: 0 is not considered an even number

Read Details

What is the output of the following code snippet? def pow(ba…

What is the output of the following code snippet? def pow(base: int, power: int) -> int:    result = 1     for i in range(0, power):        result = result * base     return result def main() -> None:    print(pow(pow(2, 2), 2)) main()

Read Details

Select suitable conditions for testing if the length of the…

Select suitable conditions for testing if the length of the string s1 is greater than 42.

Read Details

What is the output? x = 0 match x :      case _ :          m…

What is the output? x = 0 match x :      case _ :          msg = “anything”     case 0 :          msg = “zero” print(msg)

Read Details

Which code snippet tests if a temperature is between 32 and…

Which code snippet tests if a temperature is between 32 and 100? (non inclusive) Select ALL that would do the trick.

Read Details

Posts pagination

Newer posts 1 … 34 35 36 37 38 … 75,929 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top