[Tutor] Need help to print outputs on seperate files and avoid some unwanted error messages which can stop my code at some mid point

Mats Wichmann mats at wichmann.us
Thu Feb 27 19:06:58 EST 2020


On 2/27/20 4:59 PM, Alan Gauld via Tutor wrote:
> On 27/02/2020 20:53, SATYABRATA DATTA wrote:
>> There is some code
>> *import math class Vector(): def __init__(self,vx,vy,vz): self.x=vx
>> self.y=vy self.z=vz def norm(self): xx=self.x**2 yy=self.y**2 zz=self.z**2
>> return math.sqrt(xx+yy+zz)*
>>
> 
> Please always post in Plain text to the tutor list - especially if
> including code. Otherwise, the whitespace gets mangled as above
> and it all becomes a meaningless mess.


indeed, because indentation is part of the Python language syntax this
is crucially important, more so than other languages. I pasted the above
snip into a Python code reformatter to see if it could swallow it and it
said:

error: cannot format: Cannot parse:



More information about the Tutor mailing list