ezoic

Wednesday, January 25, 2017

An example looking closer to class in python

An example looking closer to class in python:

class Complex:
       def  __init__(self,realpart,imagpart):
             self.r=realpart
             self.i=imagpart

x=Complex(3.0,-4.5)
print x.r, x.i

You will get the output:

3.0  -4.5




No comments:

Post a Comment

R is not a simple programming language, and it does better on reading excel files than python

R is not a simple programming language, and it does better on reading excel files than python . tried to read excel files to python and R. i...