Run Code
|
API
|
Code Wall
|
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
prog1.py
Reading XML file to modify
Никита
PyRegFlags
Itc
isPalindrome.py
Palindrome using recursion
Python.py
Page 353 ex 42
Assignment-3c