Vote count:
0
printResults1('sandwich', 54)
The number of tweets containing sandwich is 54
printResults2('tea', 12, 'coffee', 14) #uses two print statements
The number of tweets containing tea is 12
The number of tweets containing coffee is 14
printResults3('tea', 12, 'coffee', 14) #uses two function calls to printResults1
The number of tweets containing tea is 12
The number of tweets containing coffee is 14
printResults4(['sandwich', 'tea', 'coffee'] ,[14, 56, 9]) #uses indexing and calls printResults1 three times
The number of tweets containing sandwich is 14
The number of tweets containing tea is 56
The number of tweets containing coffee is 9
printResults5(['sandwich', 'tea', 'coffee'] ,[14, 56, 9]) #uses indexing and a for loop, and has a single function call to printResults1
The number of tweets containing sandwich is 14
The number of tweets containing tea is 56
The number of tweets containing coffee is 9
What to Submit:
For this assignment, you should submit a single Python file (e.g. hw1.py) which contains
Header: comment lines on top (comments start with #) with your name and the homework number. Function Definitions: the definition of each of the above functions, and Function Calls: to test these functions with some parameter values (see the above for examples).
Can anyone please help me with these python program
Aucun commentaire:
Enregistrer un commentaire