Python - Unit 1

46 flashcards · Programming Languages · by Sikkandharbatcha J

  1. Which Python mode allows you to execute code line by line immediately?

    Interactive mode

  2. Which Python mode is used to execute an entire file of code?

    Script mode

  3. What is the main feature of Python's interactive mode?

    Immediate execution of commands

  4. In script mode, code is generally written and saved in which type of file?

    Saved in .py file

  5. What prompt symbol is shown in Python interactive mode?

    >>> prompt

  6. Which of the following is a popular Python IDE?

    PyCharm

  7. Which IDE comes bundled with Python?

    IDLE

  8. Which Python IDE is most used for data science and visualization?

    Jupyter Notebook

  9. Which code editor is widely used for Python and supports extensions?

    Visual Studio Code

  10. What does IDE stand for?

    complex

  11. Which data type is used to represent whole numbers in Python?

    int

  12. Which data type is used to represent decimal numbers?

    float

  13. Which data type is used to represent text in Python?

    str

  14. Which data type is ordered, mutable, and allows duplicates?

    list

  15. Which data type is ordered, immutable, and allows duplicates?

    tuple

  16. Which data type is unordered, mutable, and does not allow duplicates?

    set

  17. Which data type stores key-value pairs?

    dict

  18. What is the output of bool(5)?

    true

  19. Which data type is used to represent numbers with real and imaginary parts?

    complex

  20. Lists in Python are?

    mutable

  21. Which operator is used for assignment in Python?

    =

  22. Which operator is used for addition in Python?

    +

  23. Which operator checks equality between two values?

    =

  24. Which logical operator returns True if both conditions are True?

    and

  25. Which logical operator returns True if at least one condition is True?

    or

  26. Which logical operator negates a condition?

    not

  27. Which bitwise operator performs AND operation?

    &

  28. Which bitwise operator performs OR operation?

    |

  29. Which operator is used to check membership in lists, tuples, or sets?

    in

  30. Which operator checks object identity?

    is

  31. Which function is used to read input from the user?

    input()

  32. Which function is used to display output to the console?

    print()

  33. Which parameter in print() is used to specify separator between values?

    sep

  34. Which parameter in print() is used to specify what is printed at the end?

    end

  35. Which format specifier is used for integers?

    %d

  36. Which format specifier is used for floating-point numbers?

    %f

  37. Which format specifier is used for strings?

    %s

  38. Which function converts a string to an integer?

    int

  39. Which function converts a string to a floating-point number?

    float

  40. Which function converts a number to a string?

    str

  41. What is the output type of split() method in Python?

    list

  42. Which data type is created using curly braces with key-value pairs?

    dictionary

  43. What is the index of the first element in a Python list?

  44. Which function is used to find the number of items in a list?

    len()

  45. Which function generates a sequence of numbers?

    range()