Python Basics Quiz

In this notebook, I want to observe any trends related to customers.
Author

Juma Shafara

Published

September 3, 2024

Keywords

What is Python, What is Python used for?, Python Displaying output

Photo by DATAIDEA

Basic Quiz

  1. Which command is used to install Python on Windows?

    1. python install
    2. pip install python
    3. Download the installer from python.org and run it
    4. sudo apt-get install python
  2. How do you start writing a Python script?

    1. Start with main() function
    2. Write code directly without a main function
    3. Include a header file
    4. Use int main()
  3. Which extension is used for Python files?

    1. .py
    2. .java
    3. .c
    4. .cpp
  4. Which function is used to display output in Python?

    1. output()
    2. echo()
    3. printf()
    4. print()
  5. How do you display the string “Hello, World!” in Python?

    1. echo "Hello, World!"
    2. print("Hello, World!")
    3. printf("Hello, World!")
    4. output("Hello, World!")
  6. Which symbol is used for indentation in Python?

    1. Curly braces {}
    2. Semicolon ;
    3. Tab or spaces
    4. Colon `:
  7. How do you write a comment in Python?

    1. // This is a comment
    2. # This is a comment
    3. /* This is a comment */
    4. <!—This is a comment -->
  8. Which of the following is a multi-line comment in Python?

    1. ''' This is a comment '''
    2. # This is a comment
    3. // This is a comment
    4. /* This is a comment */

    END

Back to top