|
Oktatás * Programozás 2 * Szkriptnyelvek * Adator. prog. Teaching * Prog. for Data Sci. Félévek Linkek * kalendárium |
EnPy /
20121006dFile handling (removing comments) From the file string1.py remove the comment lines. For the sake of simplicity, remove only those lines that start with a Example:
def mix_up(a, b):
# +++your code here+++
return
...
# Provided main() calls the above functions with interesting inputs,
# using test() to check if each result is correct or not.
def main():
print 'donuts'
# Each line calls donuts, compares its result to the expected for that call.
test(donuts(4), 'Number of donuts: 4')
In this example there are 4 lines that need to be removed. |
![]() Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |