Oktatás * Programozás 2 * Szkriptnyelvek * levelezősök Félévek Linkek * kalendárium |
EnPy3 /
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') # leave this comment here # Each line calls donuts, compares its result to the expected for that call. test(donuts(4), 'Number of donuts: 4') if True: pass # TODO In this example there are 5 lines that need to be removed. |
Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |