New submission from Sushma <sush0...@gmail.com>:

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

----------
messages: 360865
nosy: Sush0907
priority: normal
severity: normal
status: open
title: Not convinced with the dynamic data type assignment
type: compile error
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39476>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to