Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
circle
#python 3.5.2 # Python implementation # to print circle pattern import math # function to print circle pattern def printPattern(radius): # dist represents distance to the center # for horizontal movement for i in range((2 * radius)+1): # for vertical movement for j in range((2 * radius)+1): dist = math.sqrt((i - radius) * (i - radius) + (j - radius) * (j - radius)) # dist should be in the # range (radius - 0.5) # and (radius + 0.5) to print stars(*) if (dist > radius - 0.5 and dist < radius + 0.5): print("*",end="") else: print(" ",end="") print() # Driver code radius = 10 printPattern(radius) # This code is contributed # by Deepak
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
PyTypeClass
Lesson 4 HW
String Toggling
Python
Bubble sort
Alphabet
Brother's share
problem
vocabulary
Python
Please log in to post a comment.