Apple shape | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Apple shape

Can you guys help me write a code that will output the shape of an apple using python or java.

5th Apr 2020, 2:04 AM
Ryan
Ryan - avatar
6 Answers
+ 3
https://docs.python.org/3/library/turtle.html Go through this .
5th Apr 2020, 3:22 AM
Ayush Kumar
Ayush Kumar - avatar
+ 3
That's all about python only import the turtle class .
5th Apr 2020, 3:23 AM
Ayush Kumar
Ayush Kumar - avatar
+ 3
import turtle as t t.setup(800,600,200,200) def draw_shape(sides): t.pensize(3) t.pencolor("black") for i in range(sides): t.right(360/sides) t.fd(200/sides) x = -400 y = 200 for i in range(0,100): t.up() t.goto(x,y) t.down() draw_shape(i) x = x + 80 print(x) if x > 400: x = x - 800 y = y - 100 t.done() Run this code in pydroid 3 app. This will not work in sololearn. As it is not interactive.
5th Apr 2020, 3:25 AM
Ayush Kumar
Ayush Kumar - avatar
+ 1
there is no python code in that....
5th Apr 2020, 3:16 AM
Ryan
Ryan - avatar
+ 1
ive never heard of pydroid 3 app. im newer to coding. does it work on iphone?
5th Apr 2020, 3:28 AM
Ryan
Ryan - avatar
+ 1
5th Apr 2020, 8:44 AM
Ayush Kumar
Ayush Kumar - avatar