-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
1272 lines (938 loc) · 24.9 KB
/
main.py
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# from turtle import *
# IMPORTANT NOTE
# Continuous sections of one or more characters are known as substrings.
# Substrings are defined by their starting and ending indices:
# The starting index of a substring is the index of its first character, while the ending index is the first index which is not part of the substring
# Variables
# Solve this question(challenge 01)
# num1 = 5
# num2 = 3
# sumNums = num1 + num2
# print(sumNums)
# subNums = num1 - num2
# print(subNums)
# multiplyNums = num1 * num2
# print(multiplyNums)
# sumTotalNums = sumNums + subNums + multiplyNums
# print(sumTotalNums)
# Solve this question(challenge 02)
# num = 3
# num = num + 2
# num = num * 2
# print(num)
# Solve this (challenge 03)
# For Loops
# for i in range(6):
# print("again")
# print("again")
# Solve this question(challenge 04)
# num = 10
# for i in range(3):
# print(num - i)
# for i in range(3):
# print("Coffee in, ")
# print("Code out. ")
# Solve this(challenge 05)
# Fibonacci sequence
#
# def fibonacci_sequence(start1, start2, n):
# # Initialize variables for the first two terms
# fib_sequence = [start1, start2]
#
# # Calculate subsequent terms using a loop
# for i in range(2, n):
# next_term = fib_sequence[-1] + fib_sequence[-2]
# fib_sequence.append(next_term)
#
# return fib_sequence
#
#
# # Input starting values
# start1 = int(input("Enter the first starting value: "))
# start2 = int(input("Enter the second starting value: "))
#
# # Calculate Fibonacci sequence up to the 20th term
# fib_sequence = fibonacci_sequence(start1, start2, 20)
#
# # Print the sequence
# print("Fibonacci sequence:")
# for term in fib_sequence:
# print(term, end=" ")
# Solve this quest(challenge 06)
# a = 2
# b = 5
# for i in range(2, 20): # We start the loop from the 3rd term (index 2) up to the 20th term
# c = a + b # Calculate the next term in the sequence
# a = b # Update the value of 'a' to the current 'b'
# b = c # Update the value of 'b' to the current 'c'
#
# # After the loop, 'c' will hold the 20th term of the sequence
# print("The 20th term of the Fibonacci sequence is:", c)
# Solve this(challenge 07)
# Conditional statement
# price = 12 # bananas usually cost 10
#
# if price < 10:
# print("Bananas are on sale! They cost less than $10.") # add a message here
# elif price > 10:
# print("Oops! It seems bananas are more expensive than usual.") # add a message here
# else:
# print("Bananas cost $10")
# Solve this quest
# price = 0
# if price == 0:
# print("Bananas are free!")
# elif price < 10:
# print("Bananas are on sale!")
#
# elif price > 10:
# print("Bananas are expensive")
# else:
# print("Bananas cost $10")
# Solve this(challenge 08)
# wallet = 25
#
# for price in range(5): # Using range(5) instead of range(100)
# if price < 10:
# wallet = wallet - price
# print("Now I have", wallet)
#
# print("Final amount:", wallet)
# Solve this(challenge 09)
# wallet = 9
# for price in range(5):
# if wallet >= price: # Modify the condition to check if wallet has enough money for the current price
# wallet = wallet - price
# print("Now I have", wallet)
# else:
# print("I can't buy anything for $", price, "or I don't have enough money.")
#
# print("Final amount:", wallet)
# Solve this(challenge 10)
# wallet = 8
#
# for price in range(10):
# if wallet >= price:
# wallet = wallet - price
# print("I have",wallet,"left")
# else:
# print("I can't afford any more")
# break
# Solve this(challenge 11)
# Complete this program by adding a condition on line
# 11
# 11 that checks if socks is even.
# wallet = 25
# socks = 0
#
# for price in range(10):
# if wallet >= price:
# wallet = wallet - price
# socks = socks + 1
# else:
# break
#
# if socks % 2 == 0: # fill in this condition
# print("I can pair my socks")
# else:
# print("I need one more...")
# Solve this(challenge 12)
# What condition should be inserted on line 2?
# The output should classify even and odd values.
# for n in range(4):
# if n % 2 == 0:
# print(n, "is even.")
#
#
# else:
# print(n, "is odd.")
# Solve this(challenge 13)
# What is the output?
# time = 3
# for n in range(3):
# if n < time:
# print(n)
# elif n == time:
# print("Go")
# Solve this(challenge 14)
# What is the output?
# time = 8
# for i in range(8):
# if time > 5:
# time = time -1
# else:
# print(time, "sconds")
# break
# Solve this(challenge 15)
# Consider the 3 then add 1.
#
# Repeat step 2 with the new number.
#
# The Collatz conjecture asserts that following these steps will always lead to 1 for any starting integer greater than 0.
# Complete this program so that it performs the Collatz sequence and reports how many steps it took to return to 1.
# number = 3
# steps = 0
#
# for i in range(200):
# if number == 1:
# break
# if number % 2 == 0:
# number //= 2 # Divide the number by 2 if it's even
# else:
# number = number * 3 + 1 # Multiply the number by 3 and add 1 if it's odd
# steps += 1 # Increment the step count
#
# if number == 1:
# print("It took", steps, "steps")
# else:
# print("The number didn't reach 1 yet")
# Solve this question(challenge 16)
# Starting at 27, how many steps does it take to reach 1?
# number = 27
# steps = 0
#
# while number != 1:
# if number % 2 == 0:
# number //= 2 # Divide the number by 2 if it's even
# else:
# number = number * 3 + 1 # Multiply the number by 3 and add 1 if it's odd
# steps += 1 # Increment the step count
#
# print("It took", steps, "steps to reach 1 starting from 27.")
# Solve this fun turtle drawing exercise (challenge 17)
# forward(300)
# bye()
# Solve this quest(challenge 18)
# color('red')
# forward(200)
# left(90)
# forward(200)
# left(90)
# forward(200)
# left(90)
# forward(200)
#
# bye()
# Another challenge(challenge 19)
# The program below is supposed to draw only half a square, where the turtle draws two sides and returns
# to its starting point like this:
# However, something's wrong with this code. Can you figure out which line is the problem?
# color('blue')
# forward(200)
# left(90) # Option A
# forward(200) # Option B
# left(45) # Option C
# forward(282) # Option D
#
# bye()
# Trying to fix the issue now
# color('blue')
# forward(200)
# left(90) # Option A
# forward(200) # Option B
# left(135) # Option C
# forward(282) # Option D
#
# bye()
# Program fixed successfully
# Solve this challenge(20)
# color('blue')
# forward(200)
# left(60)
# forward(200)
# left(60)
# forward(200)
#
# bye()
# This type of shape is half a Hexagon
# Solve this quest(challenge 21)
# from turtle import *
#
# color('dark turquoise')
# forward(200)
# left(90)
# forward(200)
# left(90)
# forward(200)
# left(90)
# forward(200)
#
# bye()
# Another fun challenge that draws the lines with different colors(challenge 22
# from turtle import *
#
# color('dark turquoise') # set color to 'dark turquoise'
# forward(200) # bottom of square
# left(90)
# color('fuchsia') # set color to 'fuchsia'
# forward(200) # right side of square
# left(90)
# color('deep sky blue') # set color to 'deep sky blue'
# forward(200) # top of square
# left(90)
# color('hot pink') # set color to 'hot pink'
# forward(200) # left side of square
#
# bye()
# Now lets take another exercise that draws alphabetical letters(challenge 23)
from turtle import *
# width(5) #By changing the width here to 50 or higher values could result in drawing larger font letters
# left(90)
# forward(200)
# right(90)
# forward(100)
# right(45)
# forward(71)
# right(45)
# forward(100)
# right(45)
# forward(71)
# right(45)
# forward(100)
# hideturtle()
#
# bye()
# The above code draws the alphabetical letter D
# Solve this fun exercise(challenge 24)
# Here is a similar program to solve(
# width(5)
# left(90)
# forward(200)
# right(90)
# width(50) # line added
# forward(100)
# right(45)
# forward(71)
# right(45)
# forward(100)
# right(45)
# forward(71)
# right(45)
# forward(100)
# hideturtle()
#
# bye()
# Another challenge(challenge 30)
# This exercise draws a star with a filled color
# from turtle import *
#
# speed(5)
# width(5)
#
# color('red', 'yellow') # Two inputs: a stroke color and a fill color.
#
# begin_fill() # Start of a filled shape.
# for i in range(5): # Repeat 5 times
# # The turning angle is chosen so that the star closes in on itself after five turns.
# right(180 - 36) # Turning angle
# forward(200)
# end_fill() # Fills in the shape it has been drawing
#
# hideturtle()
# bye()
# # NOTE: to draw a seven sided star, all you need is to increment the range to 7 instead 5
# from turtle import *
#
# speed(5)
# width(5)
#
# color('red', 'yellow') # Two inputs: a stroke color and a fill color.
#
# begin_fill() # Start of a filled shape.
# for i in range(7): # Repeat 5 times
# # The turning angle is chosen so that the star closes in on itself after five turns.
# right(180 - 180/7) # Turning angle
# forward(200)
# end_fill() # Fills in the shape it has been drawing
#
# hideturtle()
# bye()
# These approaches both works
# from turtle import *
#
# speed(5)
# width(5)
#
# color('red', 'yellow') # Two inputs: a stroke color and a fill color.
#
# begin_fill() # Start of a filled shape.
# for i in range(7): # Repeat 5 times
# # The turning angle is chosen so that the star closes in on itself after five turns.
# right(154.3) # Turning angle
# forward(200)
# end_fill() # Fills in the shape it has been drawing
#
# hideturtle()
# bye()
# This also works(They both works)
# from turtle import *
#
# speed(5)
# width(5)
#
# color('red', 'yellow') # Two inputs: a stroke color and a fill color.
#
# begin_fill() # Start of a filled shape.
# for i in range(7): # Repeat 5 times
# # The turning angle is chosen so that the star closes in on itself after five turns.
# right(180 - 25.7) # Turning angle
# forward(200)
# end_fill() # Fills in the shape it has been drawing
#
# hideturtle()
# bye()
# Built in Python functions(challenge 31)
# Here is the find command. Take a guess at what you think this program might output:
# str1 = "parts"
# str2 = "art"
# print(str1.find(str2))
# Built in Python functions
# Solve this challenge(challenge 32)
# str1 = "Is it going well?"
# str2 = "go"
# print(str1.find(str2))
# Predict the output of OX in this program(challenge 34)
# str1 = "XOXOXOXOXO"
# print(str1.find("OX"))
# Prerdict the outcome of find (challenge 35)
# str1 = "Hi hey hello he."
# str2 = "he"
# print(str1.find(str2))
# Run this program to see the result(challenge 35)
# str1 = "parts"
# str2 = "ps"
# print(str1.find(str2))
# Take this challenge(challenge 36)
# What do you think could be the output of this program
# str1 = "superior"
# str2 = "Perfect"
# str3 = "personally"
# str4 = "miles per gallon"
#
# print(str1.find("per"))
# print(str2.find("per"))
# print(str3.find("per"))
# print(str4.find("per"))
# Which snippet above returns a negative value (Perfect = -2(str2)
# Solve this Challenge(37)
# What do you think could be the output of this program
# test_string = "tested, testing, tests, test"
# print(test_string.find("sted"))
# The output of this program is = 2
# Solve this challenge(38)
# test_string = "tested, testing, tests, test"
# print(test_string.find("tess"))
# The output of this program is -1
# Solve this challenge(39).
# What do you think could be the output of this program
# test_string = "tested, testing, tests, test"
# print(test_string.find("test"))
# The output of this program is = 0
# Lets run this command
# # What could be the output of this program?
# str1 = "parts"
# str2 = "ps"
# print(str1.find(str2))
# The output of the program is -1
# Solve this quest(challenge 40)
# For which snippets would the find("per")
# command return a negative number?
# str1 = "superior"
# str2 = "Perfect"
# str3 = "personally"
# str4 = "miles per gallon"
#
# print(str1.find("per"))
# print(str2.find("per"))
# print(str3.find("per"))
# print(str4.find("per"))
# The command is str2 which "Perfect"
# Another challenge to solve(challenge 41)
# What could be the output of this program?
# test_string = "tested, testing, tests, test"
# print(test_string.find("sted"))
# The outcome is 2
# Solve this Challenge(challenge 42)
# What could be the output of this program
# test_string = "tested, testing, tests, test"
# print(test_string.find("tess"))
# The outcome of this program is -1
# Solve this challenge(43)
# what do you think could be the outcome of this program?
# test_string = "tested, testing, tests, test"
# print(test_string.find("test"))
# The outcome of the program is 0
# The find function is useful if you're looking for a specific set of characters in a string, but since it only returns the first instance of the search term, it has limited functionality.
# If we wanted to find the other occurrences of test in the above program, we would have to use other functions like count and rstring.
# Extracting characters from string
# str1 = "educational"
# print(str1[4])
# The outcome comes out "a"
# what number should we replace 4 with to access the letter "n"
# str1 = "educational"
# print(str1[4])
# The number is 8 which is the index value of letter "n"
# Solve this challenge (challenge 44)
# This challenge involves substrings
# word = "learning"
# print(word[1:5])
# The substring of the above program is "earn"
# Another example(challenge 45)
# word = "embossed"
# print(word[2:6])
# The substring of this program is "boss"
# Another example(challenge 46)
# word = "climb"
# print(word[2:6])
# The substring of this program is "imb"
# Another Example of substring(challenge 47)
# word = "steamer"
# start = 1
# end = 5
# print(word[start:end])
# The substring of this program is "team"
# Another example of substring(challenge 48)
# str1 = "Spam spam spam spam. Lovely spam! Wonderful spam! Spam spa-a-a-a-a-am..."
# str2 = str1[21:25] # Needs to be fixed
# print(str2)
# The substring of this program is "Love"
# Here we're starting with a string in str1 and then(challenge 49)
# copying the substring between two indices into another variable, str2. This is known as slicing.
# str1 = "scrumptious"
# # What numbers should be filled in?
# i = 1
# j = 6
# str2 = str1[i:j]
# print(str2) # Output: "crump"
# The missing numbers are 1:6
# Another Example of how to get a slice(challenge 50)
# Another way to slice strings is to access every character before or after an index.
# You can access every character after the starting index by leaving out the ending index.
# To get “equivocal” from the string "Unequivocal" stored in str1, you can just write str1[2:]:
# str1 = "Unequivocal"
# str2 = str1[2:]
# print(str2)
# The output is "equivocal"
# Another example(challenge 51)
# Similarly, we can get every character before the selected index by leaving out the starting index:
# str1 = "Goldfish"
# str2 = str1[:4]
# print(str2)
# The output of this program is "Gold"
# sentence = "I like rocks but they seem indifferent."
# # conjunction_index = sentence.find("but")
# conjunction_index = sentence.find(" but ")
# # left_side = sentence[0:conjunction_index]
# left_side = sentence[0:conjunction_index-1]
# right_side = sentence[conjunction_index + 3:]
# # right_side = sentence[conjunction_index + 4:]
# classy_sentence = left_side + "yet" + right_side
# print(classy_sentence)
# Which lines in this code should we uncomment to correctly swap the word “but” for “yet”?
# sentence = "I like rocks but they seem indifferent."
# conjunction_index = sentence.find("but")
# left_side = sentence[0:conjunction_index]
# right_side = sentence[conjunction_index + 3:]
# classy_sentence = left_side + "yet" + right_side
# print(classy_sentence)
#
# The Replace function
# forecast = "It will be rainy today."
# new_forecast = forecast.replace("rainy", "sunny")
# print(forecast) # Original forecast
# print(new_forecast) # New forecast
# Solve this quest(Challenge 52)
# greeting = "goodbye, and say hello"
# print(greeting.replace("goodbye", "hello"))
# Solve this challenge(53)
# test_string = "The replacement will be arriving shortly"
# new_string = test_string.replace("shortly", "now")
# print(test_string)
# print(new_string)
# old_string = "the old string"
# new_string = old_string.replace("old", "new")
#
# print(old_string)
# print(new_string)
#
# print("We replaced " + old_string + " with " + new_string)
# # Solve this challenge(54)
# words = "red fish"
# words.replace("red", "blue")
# print(words)
# print(words.replace("red", "blue"))
# Solve this challenge(55)
# form_letter = "Hello [Insert Name Here]. I'd like to personally thank you for your contribution."
#
# # form_letter.replace("[Insert Name Here]", "Emily")
# form_letter = form_letter.replace("[Insert Name Here]", "Emily")
# #"Emily".replace(form_letter, "[Insert Name Here]")
# # form_letter = form_letter.replace("Emily", "[Insert Name Here]")
#
# print(form_letter)
# Solve this challenge(56)
# form_letter = "Hello [Insert Name Here]. I'd like to personally thank you for your contribution."
#
# form_letter = form_letter.replace("[Insert Name Here]", "Emily")
#
# print(form_letter)
#
# form_letter = form_letter.replace("[Insert Name Here]", "Josh")
#
# print(form_letter)
# A different approach of the above challenge
# form_letter = "Hello [Insert Name Here]. I'd like to personally thank you for your contribution."
# # Write Emily a letter
# emily_letter = form_letter.replace("[Insert Name Here]", "Emily")
# # Save as new variable
# print(emily_letter)
# # Write Josh a letter
# josh_letter = form_letter.replace("[Insert Name Here]", "Josh")
# # Saved as a new letter
# print(josh_letter)
# Solve this challenge(challenge 57)
# Suppose that we want to make a message incomprehensible by switching around all the vowels. “We want bananas”, for instance, might become “Wa went benenes”
# The first step in this process is to replace all a’s with e’s and all e’s with a’s.
# sentence = "a breakfast for billy the bee is an early egg"
#
# # sentence = sentence.replace("e", "a")
# sentence = sentence.replace("e", "@")
# # sentence = sentence.replace("a", "b")
# sentence = sentence.replace("a", "e")
# sentence = sentence.replace("@", "a")
# #sentence = sentence.replace("b", "e")
# print(sentence)
# Solve this turtle challenge(challenge 58)
# for i in range(10):
# forward(15)
# left(9)
#
# bye()
# Similar program like just above but different approach
# Defining a custom function named "left_turn"
# def left_turn():
# # Start of left_turn's definition
# for i in range(10):
# forward(15)
# left(9)
# # End of the for loop
# # End of left_turn's definition
#
# # Rest of the program below
# left_turn()
# Similar challenge, just that now the function is just above the code
# This is the function call.
# left_turn()
#
# # This is the function definition
# def left_turn():
# for i in range(10):
# forward(15)
# left(9)
#
#
# bye()
# This approach doesn't work because the function is called before defined.
# Here is another similar program
# def left_turn():
# for i in range(10):
# left(9)
# forward(15)
#
# left_turn()
# left_turn()
#
# bye()
# Another good example)challenge 59)
# def left_turn():
# for i in range(10):
# left(9)
# forward(15)
#
# left_turn()
# left_turn()
# left_turn()
# left_turn()
#
# bye()
# Here's a program that defines a new function — petal. Notice how petal references the previously defined left_turn
#
# hideturtle()
# color('black', 'magenta')
#
# # This is the definition of left_turn, as before.
# def left_turn():
# for i in range(10):
# forward(15)
# left(9)
#
# # This is definition of petal
# def petal():
# begin_fill()
# left_turn() # Calls the left_turn function
# left(90)
# left_turn() # Calls left_turn again
# end_fill()
#
# petal()
# bye()
# Solve the challenge(59) from this challenge, write a program that draws flower that consist of five side petals
# from turtle import *
#
# hideturtle()
# color('black', 'magenta')
#
#
# def left_turn():
# for i in range(10):
# forward(15)
# left(9)
#
#
# def petal():
# begin_fill()
# left_turn()
# left(90)
# left_turn()
# left(90) # Line added
# end_fill()
#
#
# for i in range(5):
# petal()
# right(360 / 5)
#
# bye()
# Now that our program can draw a flower, the next step is to define a function flower that contains the part that actually draws the flower.
# Solve this challenge(60)
#
# from turtle import *
#
# hideturtle()
# color('black', 'magenta')
#
#
# def left_turn():
# for i in range(10):
# forward(15)
# left(9)
#
#
# def petal():
# begin_fill()
# left_turn()
# left(90)
# left_turn()
# end_fill()
# left(90)
#
#
# for i in range(5):
# petal()
# right(360 / 5)
#
# bye()
# Solve this challenge(61)