Skip to content

Basics


title: Python Basics Quiz keywords: [What is Python, What is Python used for?, Python Displaying output] description: In this notebook, I want to observe any trends related to customers. author: Juma Shafara date: "2024-09-03"


Photo by DATAIDEA

Basic Quiz

  1. Which command is used to install Python on Windows? A) python install B) pip install python C) Download the installer from python.org and run it D) sudo apt-get install python

  2. How do you start writing a Python script?

A) Start with main() function B) Write code directly without a main function C) Include a header file D) Use int main()

  1. Which extension is used for Python files? A) .py B) .java C) .c D) .cpp

  2. Which function is used to display output in Python?

A) output() B) echo() C) printf() D) print()

  1. How do you display the string "Hello, World!" in Python?

A) echo "Hello, World!" B) print("Hello, World!") C) printf("Hello, World!") D) output("Hello, World!")

  1. Which symbol is used for indentation in Python? A) Curly braces {} B) Semicolon ; C) Tab or spaces D) Colon `:

  2. How do you write a comment in Python?

A) // This is a comment B) # This is a comment C) /* This is a comment */ D)

  1. Which of the following is a multi-line comment in Python? A) ''' This is a comment ''' B) # This is a comment C) // This is a comment D) /* This is a comment */

END