GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

Author Archives: Anonymous

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

What is the following function f computing? def f(a: list[in…

What is the following function f computing? def f(a: list[int]) -> list[int]:    out = []    for x in a:        out.append(x * x)    return out

Read Details

Select the option below that is true regarding an if instruc…

Select the option below that is true regarding an if instruction

Read Details

What is the output of the following program? def myFun(perfe…

What is the output of the following program? def myFun(perfect: int) -> int:    return (perfect – 1) * (perfect – 1) def main() -> None:    for i in range(0, 4):        print(myFun(i) , ” “) main()

Read Details

What will the following code output? age  = 19 msg = “” matc…

What will the following code output? age  = 19 msg = “” match age :      case n if n >= 21 :         msg = “adult”     case _ :          msg = “minor” print(msg)

Read Details

You need to write a function that calculates the shipping co…

You need to write a function that calculates the shipping cost for an appliance, which depends on the item’s 3D dimensions and weight. What should be the inputs and their data types for this function?

Read Details

The term “black box” is used with functions because ________…

The term “black box” is used with functions because ___________

Read Details

What is the output of the following code snippet? s1 = “her”…

What is the output of the following code snippet? s1 = “her” s2 = “cart” if s1 < s2 :      print(s2) else:     print(s1)  

Read Details

In Python, which of the following orderings is used to compa…

In Python, which of the following orderings is used to compare strings?

Read Details

How many times does the following loop execute? upper_case_l…

How many times does the following loop execute? upper_case_letters = 0my_str = “abcdEfghI”found = Falsei = 0 while i < len(my_str) and not found :    ch = my_str[i]     if ch.isupper():      found = True     i = i + 1

Read Details

Posts pagination

Newer posts 1 … 30 31 32 33 34 … 75,924 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top