Your program is working fine. You just didn't pass the prompt string
which gets prompted on terminal to ask user's input:
a=[]
b=[]
for i in range(0,4):
m=int(raw_input(" Enter value for a list :"))
a.append(m)
for i in range(0,4):
n=int(raw_input(" Enter value for b list :"))
b.append(n)
print "list a looks like :-", a
print "list b looks like :-", b
This is how it will result:
Enter value for a list :1
Enter value for a list :2
Enter value for a list :3
Enter value for a list :4
Enter value for b list :5
Enter value for b list :6
Enter value for b list :7
Enter value for b list :8
list a looks like :- [1, 2, 3, 4]
list b looks like :- [5, 6, 7, 8]
raw_input(...)
raw_input([prompt]) -> string
Read a string from standard input. The trailing newline is stripped.
If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError.
On Unix, GNU readline is used if enabled. The prompt string, if given,
is printed without a trailing newline before reading.
If you are expecting only integers
as input you can use input
built-in function, by which there is no need to type cast it again to integer.
a=[]
b=[]
for i in range(0,4):
m = input(" Enter value for a list :")
a.append(m)
for i in range(0,4):
n = input(" Enter value for b list :")
b.append(n)
input(...)
input([prompt]) -> value
Equivalent to eval(raw_input(prompt)).