I have been trying to read set of input from prompt. The first line of prompt input represents how many lines will be supplied. For e.g
3 #This represents three values will be supplied in following lines
8
7
100
no_of_lines = int(raw_input().strip())
lines_content = []
for i in range(0,no_of_lines):
temp_content = raw_input().strip().split('\n')
lines_content.append(int(temp_content))
for j in range(0,len(lines_content)):
print(int(lines_content[j]))
Above is my code in python to read the input. I am expecting that the last print statement would print the contents of type int. But I am not able to do so. Why that type conversion is not happening ?Is there any Pythonic way to achieve above scenario ?
PS Adding Traceback
Traceback (most recent call last):
File "C:/test_project/test.py", line 5, in <module>
lines_content.append(int(temp_content))
TypeError: int() argument must be a string or a number, not 'list'