ANSWER KEY QUIZ 2

Cards (28)

  • Which operator is used as an exponent?
    **
  • Which keyword is used to define a function in python?
    def
  • what is the output of the following?
    x = 36 / 4 * (3 + 2) * 4 + 2
    print(X)
    182.0
  • what is the output of the following?
    p, q, r = 10, 20 ,30
    print(p, q, r)
    10 20 30
  • what will be the output of not (5 > 3)?
    false
  • which operator has higher precedence in the following list?
    **
  • Which keyword is used for alternative conditions in an if statement?
    elif
  • How do you start writing an if statement in Python?
    if x>y:
  • What is the output of bool(0)in Python?
    False
  • What will be the result of 10 % 3 in Python?
    1
  • What will be the output of the following code?
    var1 = 1
    var2 = 2
    var3 = "3"
    print (var1 , var2 , var3)
    1 2 3
  • What will be the output of the following code?
    valueOne = 5 ** 2
    valueTwo = 5 ** 3
    print(valueOne)
    print(valueTwo)
    25 & 125
  • In Python, 'Hello' , is the same as "Hello"
    True
  • What will be the output of the following code?
    x = 5
    y = 10
    print(x > 3 and y < 15)
    False
  • What is a correct syntax to output "Hello World" in Python?
    print("Hello World")
  • What symbol often indicates the beginning and end of a program or sub-process?
    terminal
  • What is the purpose of the diamond-shaped symbol in a flowchart?
    decision
  • Which one is NOT a legal variable name?
    my-var
  • What will be the output of the following code?
    var1 = 1
    var2 = 2
    var3 = "3"
    print(var1 + var2 + var3)
    Error
  • Which of the following is the correct way to start a comment in Python?
    #comment
  • Which of the following is an arithmetic operator in Python?
    **
  • Who is the creator of python?
    Guido van Rossum
  • Which operator can be used to compare two values?
    ==
  • What does the print() function do in Python?
    Display output on the screen
  • In which year was Python first released?
    1991
  • How do you create a variable with the numeric value 5?
    x = 5
  • What will be the output of the following code?
    x = 7
    if x % 2 == 0:
    print ( "Even")
    else:
    print("Odd")
    Odd
  • What is the file extension for Python files?
    .py