0

this is the code for calculating the area of a circle. It is an effective code or I need to improve it?

print("tinh dien tich va chu vi hinh tron") print("cong thuc tinh hinh tron la s=r*r*3.14") print("cong thuc tinh chu vi hinh tron la v=2*3.14*r") r=int(input("nhap r vao")) print(r) print("cac ban co 3 luot nhap r") lan_nhap=3 for lan_nhap in range(0,lan_nhap): lan_nhap+=1 if r<0: print("r ko hop le") r=int(input("nhap lai")) if r==0: print("r ko ton tai") r=int(input("nhap lai")) if r>0: print("bay h tinh dien tich va chu vi") cv=2*r*3.14 print("day la chu vi",cv) dt=r*r*3.14 print("day la dien tich",dt)

27th Dec 2018, 12:43 AM
Khai123
Khai123 - avatar
2 Respuestas
+ 2
> 99% of the people here don't understand Vietnamese. It's difficult to tell if a code can be improved if we can only guess what it does
27th Dec 2018, 5:50 AM
Anna
Anna - avatar
+ 1
Please paste your code in the Code Playground and share the link. It would make it easier for people to help you. Thanks!
27th Dec 2018, 4:42 AM
Diego
Diego - avatar