vocab = dict()
myvocab = {"kore":"これ", "sore":"それ", "are":"あれ" }
vocab['kore'] = 'これ'
vocab = set()
vocab.add('word')
#not append
myvocab = {"kore", "sore", "are"}
while
loops continue until the condition is not true
input()
function in Python reads a line of text input from the user and returns it as a string.
name = input("Enter your name: ")
en2cs = {
"list": "seznam",
"set": "množina",
"boolean": "booleovská hodnota",
"tuple": "ntice",
"dictionary": "slovník",
"string": "řetězec" }
Loop through the dictionary and print them nicely formatted, something like:
cs2en
(hint: loop through and set the values as keys ), then loop through the new dictionary and print it nicely formatted.
food
. Use the names of three
dishes as in your dictionary. For each food, make a dictionary of details, like ingredients, cooking time, comments. Then loop through the foods and the details, printing everything nicely.
active
break
statement
tokens = [
"Holmes", "had", "been", "seated", "for", "some", "hours", "in", "silence",
"with", "his", "long", ",", "thin", "back", "curved", "over", "a", "chemical",
"vessel", "in", "which", "he", "was", "brewing", "a", "particularly",
"malodorous", "product", ".", "His", "head", "was", "sunk", "upon", "his",
"breast", ",", "and", "he", "looked", "from", "my", "point", "of", "view",
"like", "a", "strange", ",", "lank", "bird", ",", "with", "dull", "gray",
"plumage", "and", "a", "black", "top-knot", "." ]
We will learn how to do this later!
set()
to determine how many different tokens there are
1
in
to see if a key is in a dictionary
items()
n
'*'s if the frequency is n
['.', ',', ';', 'a', 'an', 'of', 'the', 'he', 'his', 'him', 'me', 'my', 'I', 'you', 'your', 'we', 'our', 'us']
❂ If you haved finished everything else, try this
You learned:
input()
function to allow users to provide their own information in programsbreak
statementcontinue
statementLAC: Language and the Computer Francis Bond.