Login

|

Logout

Computer Science: Python Quiz


1. How do you write a for loop in python?

2. How do you write a while loop in python?

3. how do you write an if statement in python?

4. What can be used to compare two values?

5. Which of the following defines a list?

6. What is the correct way to create a function in python?

7. What is the correct way of writing a tuple?

8. What is the correct way to write a set?

9. How do you create a variable in python?

10. How do you write a comment in python?

11. How do you collect user input in python?

12. What is the correct file extension for python?

13. How do you print user input on the screen?

14. Which collection is ordered, changeable, and allows duplicate members?

15. Which collection does not allow duplicate members?

16. How do you get the first value of an array?

17. How do you create a class in python?

18. How do you create an object of a class?

19. How do you create a boolean in python?

20. How do you cast an object to a string?