- All code must be properly indent
- After class definition a ":" is required
- After every method definition a ":" is required
- Code does not use "end", so remove them all
- true = True
- false = False
- nil = None
- elsif = elif
- There are no && nor || but only "and" and "or"
- initialize does not exist, you need __init__(self):
Sample code converted from Ruby to Python:
Click Here to download
1 comment:
This shows that Python is way more readable than Ruby. I can look at the code example and tell instantly what the python code does not so with the funky Ruby!
Post a Comment