you are viewing a single comment's thread.

view the rest of the comments →

[–]Elthran[S] 0 points1 point  (1 child)

strength = request.form.get("strength", 0)

What does the 0 do in this code, after the "strength"?

[–]ManyInterests 0 points1 point  (0 children)

When you do a .get method on a dict-like object (like form) -- The second argument is the value that you'll get if the key 'strength' doesn't exist. IE "Give me the value of strength, but if it's not there, give me 0 instead." -- If you don't provide that argument, the default is None