Skip to main content

Operators

Operators Quiz

  1. What is 5 + 2 * 3 in Python?
    21
    11
    16
    7
  2. Which operator is modulus?
    %
    //
    /
    *
  3. What does “==” operator do?
    Assign
    Equals to
    Not equals
    Greater than
  4. Which operator means "not equal"?
    !=
    =!
    ==
    <>
  5. What is the result of 7 // 2?
    3
    3.5
    4
    Error
  6. Which logical operator means OR?
    and
    or
    not
    ||
  7. What is the output of 10 > 5 and 5 < 3?
    True
    False
    10
    5
  8. Which operator is used for string concatenation?
    +
    &
    *
    %
  9. What is the output of 3 ** 2?
    6
    9
    8
    5
  10. What operator is used for floor division?
    /
    //
    %
    ^

Comments

Popular posts from this blog

Fun time

Projects and Fun Activities Quiz Which module helps in drawing shapes? turtle draw graphics paint What is a simple project idea for beginners? Calculator Operating system Database Web browser Which helps create interactive quizzes? input() print() loops all of these What does the turtle.forward() command do? Moves turtle forward Turns turtle right Pauses program Changes color What structure stores quiz questions? List Tuple String Integer What can you use to track scores? Variable List Function Module Turtle graphics is used for: Drawing Networking File handling Calculations What command clears the screen in turtle? turtle.clear() turtle.reset() turtle.er...

Answers in detail

 Introduction to Python (10 Questions)Who developed Python? a) Dennis Ritchie b) Guido van Rossum c) James Gosling d) Bjarne Stroustrup Answer: bWhich year was Python created? a) 1989 b) 1991 c) 2000 d) 2010 Answer: bWhat type of language is Python? a) Compiled b) Interpreted c) Assembly d) Machine Answer: bWhich is the correct extension for Python files? a) .py b) .java c) .txt d) .exe Answer: aWhat is the first command used to print in Python? a) print() b) echo() c) console.log() d) output() Answer: aPython is named after: a) A snake b) Monty Python's Flying Circus c) A programmer d) A city Answer: bWhich symbol is used to comment in Python? a) // b) -- c) # d) /* Answer: cWhat does PEP stand for in Python? a) Python Enhancement Proposal b) Python Easy Programming c) Programming Environment Protocol d) Programmer’s Education Path Answer: aWhich IDE is commonly used for Python coding? a) Visual Studio Code b) Eclipse c) PyCharm d) Notepad Answer: cWhat will print("Hello...

Variables & Data Types (Questions 11–20)

Variables & Data Types Quiz Which is a valid variable name? 1var var_1 var-2 @var Choose the correct data type for: 45 String Integer Float Boolean True or False values are called: Strings Booleans Integers Floats What will type("Hello") return? int float str bool Which of these is a floating-point number? 10 '10' 10.5 True How to take input from user in Python? input() scan() get() read() What is the value of variable x after x = 5 + 2? 7 "7" 52 Error Can variable names start with a number? Yes No Which is NOT a Python data type? List Set Number Array Is Python case-sensitive i...