Python Forum
Python Starter-Looking for help! - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Python Starter-Looking for help! (/thread-24198.html)



Python Starter-Looking for help! - PythonStarter55561 - Feb-03-2020

,hello

I'm a new python starter and I need help in a script that I need to make.

In the script, the user needs to input the length of the square's rib,

and from the length, the script needs to make a square that is made by 2 triangles with the length of the rib.
i need to use the import turtle and import time.
I'm using Python IDLE 3.7.4

thx!


RE: Python Starter-Looking for help! - micseydel - Feb-03-2020

We'd be happy to help. What have you tried?


RE: Python Starter-Looking for help! - PythonStarter55561 - Feb-03-2020

(Feb-03-2020, 09:57 PM)micseydel Wrote: We'd be happy to help. What have you tried?

ive tried to do it but i dont know how to create the square from 2 triangles.


RE: Python Starter-Looking for help! - Marbelous - Feb-04-2020

Is that the actual wording of the assignment? I see no reason to import time. You might need math (sqrt) though depending on the way you need to solve this.
Of course you already do know how to create a square from two triangles. If you draw a square and then a line connecting two opposite corners you have two triangles with the line you drew being the hypotenuse of both triangles. They are also right triangles which means you can use simple trigonometry to calculate the length of the other sides which is the size of the square.
Why you need to draw the square with the turtle module instead of just printing the size is a bit weird though.
Show us the actual assignment and any code you've written and we can help you figure this out...