myvocab = ["kore", "sore", "are"]
vocab = list()
vocab.append('word')
vocab.insert('another')
myvocab = ("kore", "sore", "are")
myques = ("dore", )
## need the comma to distinguish from a function
'some things'.split()
', '.join(['some', 'things'])
print()
call to the end of your program, informing people that you found a bigger table.
insert()
to add one new guest to the beginning of your list.
insert()
to add one new guest to the middle of your list.
append()
to add one new guest to the end of your list.
len()
to print a message indicating the number
of people you’re inviting to dinner.
for
loop to print a message to each of your guests, and then write a general message to all of them outside of the list
len()
and max()
to say how long the longest name is
Problems adapted from PCC 3.4, 3.6, 3.9
n
copies of the string!
for i in range(1, 7): print('*' * i) for i in range(7, 13): print('*' * (12 -i))
min()
and max()
to make sure your list actually starts at one and ends at one million. Finally, use sum()
to sum them.
[(1,1), (2,4), (3,9), ...]
. Then use a for
loop and an fstring
to print The square of 1 is 1, The square of 2 is 4, ...
japanese_numerals = ("一", "二", "三", "四", "五", "六", "七", "八", "九", "十")
'十', '九', '八', '七', '六', '五', '四', '三', '二', '一']
data = [
# Korean Onomatopoeia
("개굴개굴", "gaegul-gaegul", "Ribbit (frog sound)"),
("멍멍", "meong-meong", "Woof (dog barking)"),
("야옹", "ya-ong", "Meow (cat sound)"),
("딸랑딸랑", "ddal-lang-ddal-lang", "Jingle (bell sound)"),
]
Some problems adapted from PCC 4-5.
list1[0]
, list1[-1]
, ...
list1[first:last:step]
[fun(w) for w in V if p(w)]
LAC: Language and the Computer Francis Bond.