Swap function parameters and delete all comments in python.
Swap function parameters and delete all comments in python.
Start file
# caculate area
def calculate_area(width, height): # width, height
return width * height # return area
area1 = calculate_area(5, 10)
area2 = calculate_area(8, 12)
End file
def calculate_area(height, width):
return width * height
area1 = calculate_area(5, 10)
area2 = calculate_area(8, 12)
View Diff
1,3c1,2 < # caculate area < def calculate_area(width, height): # width, height < return width * height # return area --- > def calculate_area(height, width): > return width * height
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 70 remaining solutions by signing in and submitting your own entry
VimGolf