Skip to content

Instantly share code, notes, and snippets.

@blongho
Created September 26, 2017 16:25
Show Gist options
  • Save blongho/6c3d9bd92ba5667132dd21110a4937d3 to your computer and use it in GitHub Desktop.
Save blongho/6c3d9bd92ba5667132dd21110a4937d3 to your computer and use it in GitHub Desktop.
def squares_in_range1():
"""
Assumptions:
1. multiplication() function works well
2. in_range() function works well
Takes values and checks if the square of the number is in range (i.e btn 50 and 100)
Computes square using multiplication(num, num)
If in range, it gets the string, "Inside", otherwise "Outside"
"""
inside = "Inside,"
outside = "Outside,"
answer_str = ""
for num in range(4, 18):
if in_range(multiplication(num, num)):
answer_str += inside
else:
answer_str += outside
return answer_str[:-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment