loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.67760160717634","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IG1hdGgKIApjbGFzcyBDaXJjbGU6CiAKICAgIGRlZiBfX2luaXRfXyhzZWxmLCByYWRpdXMpOgogICAgICAgIHNlbGYuX19yYWRpdXMgPSByYWRpdXMKIAogICAgZGVmIHNldFJhZGl1cyhzZWxmLCByYWRpdXMpOgogICAgICAgIHNlbGYuX19yYWRpdXMgPSByYWRpdXMKIAogICAgZGVmIGdldFJhZGl1cyhzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi5fX3JhZGl1cwogCiAgICBkZWYgYXJlYShzZWxmKToKICAgICAgICByZXR1cm4gbWF0aC5waSAqIHNlbGYuX19yYWRpdXMgKiogMgogCiAgICBkZWYgX19hZGRfXyhzZWxmLCBhbm90aGVyX2NpcmNsZSk6CiAgICAgICAgcmV0dXJuIENpcmNsZSggc2VsZi5fX3JhZGl1cyArIGFub3RoZXJfY2lyY2xlLl9fcmFkaXVzICkKIAogICAgZGVmIF9fZ3RfXyhzZWxmLCBhbm90aGVyX2NpcmNsZSk6CiAgICAgICAgcmV0dXJuIHNlbGYuX19yYWRpdXMgPiBhbm90aGVyX2NpcmNsZS5fX3JhZGl1cwogCiAgICBkZWYgX19sdF9fKHNlbGYsIGFub3RoZXJfY2lyY2xlKToKICAgICAgICByZXR1cm4gc2VsZi5fX3JhZGl1cyA8IGFub3RoZXJfY2lyY2xlLl9fcmFkaXVzCiAKICAgIGRlZiBfX3N0cl9fKHNlbGYpOgogICAgICAgIHJldHVybiAiQ2lyY2xlIHdpdGggcmFkaXVzICIgKyBzdHIoc2VsZi5fX3JhZGl1cykKIApjMSA9IENpcmNsZSg0KQpwcmludChjMS5nZXRSYWRpdXMoKSkKIApjMiA9IENpcmNsZSg1KQpwcmludChjMi5nZXRSYWRpdXMoKSkKIApjMyA9IGMxICsgYzIKcHJpbnQoYzMuZ2V0UmFkaXVzKCkpCiAKcHJpbnQoIGMzID4gYzIpICMgQmVjYW1lIHBvc3NpYmxlIGJlY2F1c2Ugd2UgaGF2ZSBhZGRlZCBfX2d0X18gbWV0aG9kCiAKcHJpbnQoIGMxIDwgYzIpICMgQmVjYW1lIHBvc3NpYmxlIGJlY2F1c2Ugd2UgaGF2ZSBhZGRlZCBfX2x0X18gbWV0aG9kCiAKcHJpbnQoYzMpICMgQmVjYW1lIHBvc3NpYmxlIGJlY2F1c2Ugd2UgaGF2ZSBhZGRlZCBfX3N0cl9fIG1ldGhvZA=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import math
 
class Circle:
 
    def __init__(self, radius):
        self.__radius = radius
 
    def setRadius(self, radius):
        self.__radius = radius
 
    def getRadius(self):
        return self.__radius
 
    def area(self):
        return math.pi * self.__radius ** 2
 
    def __add__(self, another_circle):
        return Circle( self.__radius + another_circle.__radius )
 
    def __gt__(self, another_circle):
        return self.__radius > another_circle.__radius
 
    def __lt__(self, another_circle):
        return self.__radius < another_circle.__radius
 
    def __str__(self):
        return "Circle with radius " + str(self.__radius)
 
c1 = Circle(4)
print(c1.getRadius())
 
c2 = Circle(5)
print(c2.getRadius())
 
c3 = c1 + c2
print(c3.getRadius())
 
print( c3 > c2) # Became possible because we have added __gt__ method
 
print( c1 < c2) # Became possible because we have added __lt__ method
 
print(c3) # Became possible because we have added __str__ method