I want to create a set of roll no. of students So I input the total no. of students and then input each roll no.
here is the code:
a=int(input())
s1=set()
for i in range(0,a):
num=int(input())
s1.add(num)
but when I run the code and input values I get this error
9
1 2 3 4 5 6 7 8 9
Traceback (most recent call last):
File "C:\Users\vepul\eclipse-workspace\demo\dash.py", line 4, in <module>
num=int(input())
ValueError: invalid literal for int() with base 10: '1 2 3 4 5 6 7 8 9'