GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Python allows you to pass multiple arguments to a function….

Python allows you to pass multiple arguments to a function.  

Read Details

What does the following program do? import turtle def main()…

What does the following program do? import turtle def main(): turtle.hideturtle() square(100,0,50,’blue’) def square(x, y, width, color): turtle.penup() turtle.goto(x, y) turtle.fillcolor(color) turtle.pendown() turtle.begin_fill() for count in range(2): turtle.forward(width) turtle.left(90) turtle.end_fill() if __name__ == ‘__main__’: main()                          

Read Details

What is the result of the following Boolean expression, give…

What is the result of the following Boolean expression, given that x = 5, y = 3, and z = 8? x < y or z > x  

Read Details

Short -circuit evaluation is only performed with the not ope…

Short -circuit evaluation is only performed with the not operator.  

Read Details

What will be displayed after the following code is executed?…

What will be displayed after the following code is executed? for num in range(0, 20, 5): num += num print(num)  

Read Details

A(n) ________ is a diagram that graphically depicts the step…

A(n) ________ is a diagram that graphically depicts the steps that take place in a program.  

Read Details

Python allows you to compare strings, but it is not case sen…

Python allows you to compare strings, but it is not case sensitive.  

Read Details

What will display after the following code is executed? def…

What will display after the following code is executed? def main(): print(“The answer is”, magic(5)) def magic(num): answer = num + 2 * 10 return answer if __name__ == ‘__main__’: main()            

Read Details

Write code that prompts the user to enter a positive nonzero…

Write code that prompts the user to enter a positive nonzero number and validates the input. Print the number of digits that this number has. For example, the number 547 has 3 digits. To solve the problem, you must count how many times you can divide the number by 10 and get a nonzero remainder. For example, dividing 547 by 10 results in 54. Dividing 54 by 10 results in 5. Dividing 5 by 10 results in zero.  You must use a loop for this problem.

Read Details

Unlike other languages, in Python the number of values a fun…

Unlike other languages, in Python the number of values a function can return is limited to one.  

Read Details

Posts pagination

Newer posts 1 … 33,583 33,584 33,585 33,586 33,587 … 89,590 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top