Part 1 Flashcards
Learn the basics
1
Q
Read a line from text file to variable
A
line = file.readline()
2
Q
Define a function that returns a variable
A
def function(a): return(a)
3
Q
break a string into a list of words, save into variable
A
str_list = “a-b-c-d -e -“.split(‘-‘)
4
Q
sort a list
A
string = sorted(list)