Tag Archives | questions

python-logo

Python Q&A – Classes, Error Handling and I/O

Question 1: Accessing a Dictionary Dictionaries are iterable objects that store associations between ‘keys’ and values, which allow extraction of specific data by entering the specific key of the dictionary. Let’s say a dictionary: Meat = { ‘chicken’: 0, ‘beef’: 1, ‘pork’: 2} To extract the value of chicken, we would type Meat[‘chicken’] to get […]

Continue Reading 0
python-logo

Python: Intro – Basic Questions

*Please note that the comments in the code, started by the hashtag, are for educational purposes and do not change the code. Question 1: Introduction: Hello, World! Printing text (e.g. Hello World) Task: Output the string ‘Hello, World!’ Answer: Explanation: Quotations are required because we want to print a string. However, if the task required […]

Continue Reading 0

Powered by WordPress. Designed by WooThemes

Free WordPress Themes