Spyke

Posts

unpopularopinion·Unpopular OpinionbyTheSmartDude

When one learn a new language, the 1st thing one should learn is to say is "Help, I'm dying!", instead of a greeting.

You never know when you might need to say "Help, I'm dying" in a foreign country, and the sooner you learn how to say it in the local language, the better your chances of survival are.

However, your chances of survival don't depend on whether you know the local greeting or not, since it's mostly used in a casual conversation, not a life-threatening situation. Therefore, one should 1st learn how to say the phrase "Help, I'm dying", and then learn the greeting.

View original on lemmy.world

Another program I coded in high-school to draw a triangle.

Triangle=turtle.Turtle#Making the turtle easily callable. Side_1=float(input("How many pixels should the 1st side of the triangle be?"))#Asking the user the length of the 1st side of the triangle. Side_2=float(input("How many pixels should the 2nd side of the triangle be?"))#Asking the user the length of the 2nd side of the triangle. Side_3=float(input("How many pixels should the 3rd side of the triangle be?"))#Asking the user the length of the 3rd side of the triangle. Angle_1=float(input("How many degrees should the 1st angle be?"))#Asking the user the measure of the 1st angle of the triangle. Angle_2=float(input("How many degrees should the 1st angle be?"))#Asking the user the measure of the 2nd angle of the triangle. Angle_3=float(input("How many degrees should the 1st angle be?"))#Asking the user the measure of the 3rd angle of the triangle. if Angle_1+Angle_2+Angle_3!= 180:#If the angles of the triangle do not add up to 180 degrees. print("The angles of a traingle must add up to 180 degrees.") elif (Side_1>Side_2 and Angle_1<Angle_2) or (Side_2>Side_1 and Angle_2>Angle_1) or (Side_3>Side_2 and Angle_3>Angle_2) or (Side_3<Side_2 and Angle_3<Angle_2) or (Side_3>Side_1 and Angle_3>Angle_1):#If both the side and its opposing angle are larger than another side and its respective opposive angle. print("If an angle is greater than another angle, then the side opposing the 2nd angle should be greater than the side opposing the 1st angle.")#Printing an appropriate message. else:#If everything works fine. pass#The rest fo the code happens. class Side(Triangle):#Drawing a side. def init(self,Side,Angle):#Making the attributes easily callable. self.Side=Side#The side of the triangle. self.Angle=Angle#The angle of the triangle. def Draw(self):#Drawing a side. Triangle.forward(self.Side)#Drawing the side. Triangle.left(self.Angle)#Turning the pen. Sides=[Side_1,Side_2,Side_3]#The sides of the triangle. Angles=[Angle_1,Angle_2,Angle_3]#The angles of the triangle. for Side_number in range(0,2):#This loop will run until all 3 sides have been drawn. Side=Side(Sides[Side_number],Angles[Side_number])#Creating an object for the sides and angles. Side.Draw#Drawing the sides.

View original on lemmy.world