Cards (11)

  • What function is used to print variables in Python?
    print()
  • How can multiple variables be printed in Python?
    By separating them with commas
  • What are the techniques for output formatting in Python?
    • Using format() method
    • Manipulating sep and end parameters
    • Using f-strings
    • Using % operator
  • What does the format() method do in Python?
    Formats output for printing
  • What are the sep and end parameters used for in print()?

    To customize output formatting
  • What is an f-string in Python?
    A way to format strings using expressions
  • What does the % operator do in Python?
    Formats strings similar to C's printf
  • What are the format specifiers used with the % operator?
    • %d – integer
    • %f – float
    • %s – string
    • %x – hexadecimal
    • %o – octal
  • How can multiple inputs be taken from the user in Python?
    Using the input() function and split() method
  • What does the input() function return by default?
    User input as a string
  • What is the syntax for the input() function?
    input(prompt)