Introduction to Python Set-2

Instruction:-

  • Number of Questions : 25
  • Total Marks : 25
  • Each question carry 1 Marks.
  • No negative marking

  •  

    Results

    #1. Which of the following is the correct way to print something in Python?

    #2. What is the correct file extension for Python files?

    #3. Which of the following is a valid variable name in Python?

    #4. What will be the output of this code: print(3 + 2 * 2)?

    #5. Which data type is used to store whole numbers in Python?

    #6. What does the input() function do in Python?

    #7. How do you write a comment in Python?

    #8. What will be the result of int(“5”) + float(“2.5”)?

    #9. Which of these is a correct if statement in Python?

    #10. Which of the following is a boolean value in Python?

    #11. What is the output of this code?
    x = 10
    x = x + 5
    print(x)

    #12. What keyword is used to create a loop that repeats a set number of times?

    #13. What will be the output of this code?
    for i in range(3):
    print(“Hi”)

    #14. What is the result of 7 // 2 in Python?

    #15. Which of the following is used to define a function in Python?

    #16. What does this code print?
    x = “5”
    y = 2
    print(x * y)

    #17. Which of the following is a correct while loop?

    #18. Which statement is used to skip the rest of the current loop iteration?

    #19. What is the output of this code?
    a = 10
    b = 20
    if a > b:
    print(“A”)
    else:
    print(“B”)

    #20. Which data type would best store a value of 3.14?

    #21. Which of the following is a boolean value in Python?

    #22. What will be the output of this code?
    print(9 % 2)

    #23. Which of the following is not a valid Python keyword?

    #24. What is the purpose of break in loops?

    #25. Which operator is used to compare two values?

    Previous
    Finish

    Leave a Comment

    Your email address will not be published. Required fields are marked *