Pre‐test exam - up1/course-python-workshop GitHub Wiki
- A. 2nd_var
- B. my-var
- C. my_var
- D. my var
- A. List
- B. Dictionary
- C. Tuple
- D. Set
- A. 1, 2, 3, 4, 5
- B. 0, 1, 2, 3, 4
- C. 0, 1, 2, 3, 4, 5
- D. 1, 2, 3, 4
x = [i for i in range(3)]
print(x)
- A. [1, 2, 3]
- B. [0, 1, 2, 3]
- C. [0, 1, 2]
- D. 0 1 2
{i: i*i for i in range(3)}
- A. {1: 1, 2: 4, 3: 9}
- B. {0: 0, 1: 1, 2: 4}
- C. 0 1 2
- D. [0, 1, 4]
- A. global variable
- B. keyword to refer to parent class
- C. reference to the current instance
- D. decorator
- A. Open file for writing
- B. Open file in append mode
- C. Open file for reading
- D. Deletes the file
- A. POST
- B. PUT
- C. GET
- D. DELETE
- A. function
- B. loop
- C. blueprint for creating objects
- D. package
- A. It initializes the class
- B. It deletes the object
- C. It prints class attributes
- D. It imports the class
- A. 201
- B. 500
- C. 200
- D. 302
- A. Web scraping
- B. Plotting graphs
- C. Numerical computation
- D. APIs
- A. {1, 2, 3}
- B. [1, 2, 3]
- C. (1, 2, 3)
- D. <1, 2, 3>
- A. Data cleaning
- B. Image processing
- C. Data visualization
- D. Web scraping
- A. Calls the init method of the base class
- B. Deletes the current instance
- C. Returns the string representation of the object
- D. Calls the destructor of the base class
- A. PUT is idempotent; POST is not
- B. POST is idempotent; PUT is not
- C. PUT is used for deleting resources; POST is used for creating resources
- D. There is no difference between PUT and POST
- A. To ensure that the server responds quickly
- B. To verify that incoming data meets expected formats and constraints
- C. To authenticate users
- D. To optimize database queries
- A. pymysql
- B. mysql-connector-python
- C. MySQLdb
- D. sqlalchemy
- A. using string concatenation to build queries
- B. using parameterized queries with placeholders
- C. limiting user input length
- D. encrypting the database
- A. 3306
- B. 5432
- C. 1521
- D. 1433