Python Dictionary Concepts List PDF

Summary

This document is a list of practice questions for Python programming, focusing on dictionary concepts and usage. Each question details aspects of working with dictionaries in Python, such as retrieval of keys and values, control flow with loops and conditions, and understanding the functionalities of Python's `for`, `if`, `pass`, `break`, `continue`, `del`, and `len` functions. The document is pertinent to secondary or high school programming.

Full Transcript

1. Know the syntax of [retrieving a value] from a dictionary by specifying its key. 2. Predict the outcome of the program which uses an **if** statement to check whether the key exists in the dictionary by using the **in** operator 3. Predict the outcome of the program which uses an...

1. Know the syntax of [retrieving a value] from a dictionary by specifying its key. 2. Predict the outcome of the program which uses an **if** statement to check whether the key exists in the dictionary by using the **in** operator 3. Predict the outcome of the program which uses an **if** statement to check whether the key exists in the dictionary by using the **not** **in** operator 4. Know the function of the **BREAK** statement 5. Know the syntax of [retrieving a key] from a dictionary 6. Know the function of the **PASS** statement 7. Predict the outcome of the program which uses **COUNT** in the **for** loop containing an **If** statement 8. Know the definition of the **Python dictionary** 9. Predict the outcome of the program which uses **del** and **len** functions 10. Predict the outcome of the program which uses **break** functions 11. Predict the outcome of the program which uses **continue** functions and **"num % 2 == 0"** expression 12. Write a line of code assign a value of a key of the dictionary to a variable 13. Know the function of the **len** function 14. Predict the outcome of the program which uses **pass** function in the loop containing an **If** statement 15. Know the function of the **continue** function 16. Being able to name **loop control statements** 17. Predict the outcome of the program which uses **pass** function in the **for** loop containing an **If** statement 18. Predict the outcome of the program which uses **break** function in the **for** loop containing an **If** statement and **"num % 2 == 0"** expression 19. Know the correct syntax to **declare a dictionary** 20. Predict the outcome of the program which uses **continue** function in the **for** loop containing an **If** statement 21. Predict the outcome of the program containing a dictionary which uses **len** function together with a **print** function 22. Predict the outcome of the program which uses **pass** function with **"num % 2 == 0"** and **"num % 3 == 0"** expressions 23. Predict the outcome of the program which uses **break** functions 24. Know the syntax of [retrieving a key] from a dictionary using a **for** loop 25. Predict the outcome of the program which uses **continue** function in the **for** loop containing an **If** statement with **"num % 2 == 0"** expression and a **range** function (containing 2 parameters) 26. Predict the outcome of the program which uses an **if** statement to check whether the key exists in the dictionary by using the **in** operator 27. Predict the outcome of the program which uses **continue** function in the **for** loop containing an **If** statement with **"num % 2 == 0"** expression and a **range** function (containing 1 parametor) 28. Know the correct syntax to **enclose the entire Python dictionary declaration** 29. Know the correct syntax **to print all the keys in the Dictionary.** 30. Predict the outcome of the program which uses **pass** function in the **for** loop containing an **If** statement and **"num % 3 == 0"** expressions

Use Quizgecko on...
Browser
Browser