Does this make sense for determining how "square" a photo is?ratio = min(pic.width, pic.height) / max(pic.width, pic.height)
if ratio > min_squareness: print("squarish")
pls
>>53741108
Not enough info
A square will have a ratio of 1 right? The way you have it, your ratio will always be less than or equal to one. So I don't think your way will ever print your message.
What you need to do is get a ratio and check to see how far away from 1 it is. The closer to one, the more square it is.
>>53741108
Yes op, it makes perfect sense.
Take the ratio of the smaller/the larger - a number that will be between (0,1] - and year to see if the radio is great than a minimum tolerance (such as 0.8, 0.9, etc)
>>53742828
IT can be greater than one, depending on what side is longer. Just determine how close to 1 the ratio is with a range of tolerance
>>53742828
Oh, and determining upon your requirements, you might want to square the ratio to give it a sharper slope.
>>53742878
No it can't. Not in his code (min/max) it'll always be <= 1
>>53742828 Me
>>53742874
Actually, he's right. It'll print your message if you use a minimum tolerance as your min_squareness. For some reason I was thinking it would be 1. I think your way is good.