Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

punto1

class Punto:

    def __init__(self,x,y):
        self.x=x
        self.y=y

    def imprimir(self):
        print("Coordenada del punto")
        print("(",self.x,",",self.y,")")

    def imprimir_cuadrante(self):
        if self.x>0 and self.y>0:
            print("Primer cuadrange")
        else:
            if self.x<0 and self.y>0:
                print("Segundo cuadrante")
            else:
                if self.x<0 and self.y<0:
                    print("Tercer cuadrante")
                else:
                    if self.x>0 and self.y<0:
                        print("Cuarto cuadrante")


# bloque principal

punto1=Punto(10,-2)
punto1.imprimir()
punto1.imprimir_cuadrante()
Comment

PREVIOUS NEXT
Code Example
Python :: Python OrderedDict - LRU 
Python :: pathlib is symbolic link 
Python :: Python fibonacci series (Recursion) 
Python :: python selenium class 
Python :: keras.utils.plot_model keeps telling me to install pydot and graphviz 
Python :: Missing Data Plotly Express px.data 
Python :: Python - Comment supprimer Commas de la corde 
Python :: why is python so populair 
Python :: reverse words and swapcase in python 
Python :: arcpy line density 
Python :: coreurls.py' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import. 
Python :: pycountry get 
Python :: what is the difference between max-width and flex-basis 
Python :: python quickly goto line in file 
Python :: groupby sum and mean 2 columns 
Python :: python recase 
Python :: find number of x greater than threshold in list python 
Python :: regex library with def (apply , lambda) 
Python :: mostFrequentDays python 
Python :: run pine script in python 
Python :: IndexError: child index out of range in parsing xml for object detection 
Python :: django query column 
Python :: nlp generate parse tree in python 
Python :: git ignore everything but python files 
Python :: torch.nn.Linear(in_features, out_features, bias=True) discription 
Python :: can i register a list in python for input 
Python :: matplotlib plt.sapect 
Python :: how to convert small letters to capital letters in python 
Python :: fibonacci sequence generator python 
Python :: how to move a specific row to last row in python 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =