Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Articles by Ayush Gupta
2 articles
Python: Can not understand why I am getting the error: Can not concatenate 'int' and 'str' object
This error is coming because the interpreter is replacing the %d with i and then trying to add 1 to a str, ie, adding a str and an int. In order to correct this, just surround the i+1 in parentheses. exampleprint("\ Num %d" % (i+1))
Read MoreTypeError: __init__() takes exactly 1 argument (5 given)
You need to indent all the method definitions so that they are under the class. exampleclass A(): def __init__(): passYou can learn more about indentation and how it needs to be used in Python here −https://www.tutorialspoint.com/python_online_training/python_lines_and_indentation.asp
Read MoreShowing 1–2 of 2 articles
« Prev
1
Next »
Advertisements