<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">Python: loan = input("Loan: ")</blockquote>
Correct input would be: loan = float(input(...))</blockquote>
I tested the code that line was from using PyCharm as my IDE and
it ran without any errors or warnings.<br>
</blockquote>
</p>
<p>Have you also verified the result. If you have used "+" or "*" as
the operator, then your script might have run successfully, but it
might not have done what you have expected.</p>
<blockquote>
<pre>Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> loan = input("Loan: ")
Loan: 5
>>> loan + loan
'55'
</pre>
</blockquote>
<p>Python has a rather strict (but dynamic) type system. There is no
type coercion. If you would use another operator, like "/", you
would get an exception. You would also get an exception with "+"
if you mix the types (e.g. 100 + "5").<br>
</p>
<p>
<blockquote type="cite">Dont confuse good languages with js :)</blockquote>
</p>
<p>In JS, you might actually also have to parse the string, unless
you have used an operator which is not defined on strings, in
which case type coercion might do the conversion for you. But
relying on type coercion is also often seen as bad practice and
nothing I would see as an advantage. For example "5" + "5" is also
"55" in JavaScript.</p>
</body>
</html>