Python3 allows some keywords to be assigned values (Which is bad according to my professor...)
For example:
>>> int = 10
>>> print(int)
10
>>> #But...
>>> print = 20
>>> print(print)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'int' object is not callable
But in C++:
#include<iostream>
int main(){
int int=0; //yeah, this is absurd...
printf("%d",int);
return 0;
}
Output:
Hello.cpp: In function ‘int main()’:
Hello.cpp:3:9: error: expected unqualified-id before ‘=’ token
int int=0;
^
Hello.cpp:4:14: error: expected primary-expression before ‘int’
printf("%d",int);
Should not keywords
be denied assignment of values in Python, like in C++?