This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Sush0907
Recipients Sush0907
Date 2020-01-28.12:01:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580212898.77.0.322385429118.issue39476@roundup.psfhosted.org>
In-reply-to
Content
Hi 

Please find below example and the compiler error,

when i'm assigning value dynamically and when we comparing in "if" loop it is throwing compiler error. It should not throw error it should assign and act as int why it is thinking as string.
Code Snippet:
print("Hello World")

num = input("Enter number ")

print(num)

if(num%3 == 0):
    num+=num
    print(num)

Output in Console:
Hello World
Enter number 15
15
Traceback (most recent call last):
    File "main.py", line 15, in <module>
       if(num%3 == 0):
TypeError: not all arguments converted during string formatting
History
Date User Action Args
2020-01-28 12:01:38Sush0907setrecipients: + Sush0907
2020-01-28 12:01:38Sush0907setmessageid: <1580212898.77.0.322385429118.issue39476@roundup.psfhosted.org>
2020-01-28 12:01:38Sush0907linkissue39476 messages
2020-01-28 12:01:38Sush0907create