COMP 102 Lecture Notes - Lecture 7: Json

9 views3 pages

Document Summary

Then, code that will retrieve definitions from that dictionary file you made. Generally declare all the toolkits you are importing at the top of the files. Gives you access in all the tools in the toolbox. Syntax for pulling something out a python dictionary. Looks similar for pulling a value out of a python list. Keyword : a word that has a special meaning in a programming language. Used only to return a function or bring in a toolbox, therefore cannot be used as function or variable names. If the dictionary does not contain the word that you are looking for, you will receive a key error . Editing your code so that you print where the error is. This helps you figure out where your error was so that you can better address it. We want to put lines 4-13 in a for loop. Lets you keep inputting a word to receive a definition.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents