How do I set the maximum number a calculation can get in Python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I set the maximum number a calculation can get in Python?

This is my current script. a = ((COMP / ATT - 0.3) * 5) b = ((YDS / ATT - 3) * 0.25) c = ((TD / ATT) * 20) d = 2.375 - (INT / ATT * 25) I want all of the variables above to have a maximum of 2.375 and a minimum of 0. How would I go about doing that? I've already set the variables of the words in this code already, so don't worry about that.

31st Jul 2019, 4:17 PM
PolarDenkd
PolarDenkd - avatar
1 Answer
0
Nevermind, I saw this string online: if a >= 2.375: a =2.375 I did the opposite to make the variable's minimum 0 and it works perfectly fine. I've finished it yet I'm not sure if I can share links, but it's my very first code available to the public so just check it out on my profile!
31st Jul 2019, 4:41 PM
PolarDenkd
PolarDenkd - avatar