2010/6/12 yanhua <gasf...@163.com> > hi,all! > it's a simple question: > input two integers A and B in a line,output A+B? > > this is my program: > s = input() > t = s.split() > a = int(t[0]) > b = int(t[1]) > print(a+b) > > but i think it's too complex,can anybody tell to slove it with less code. > -- >
The reason it looks complicated is because you're using one variable for everything you do. Look at others' answers - most of them are simply combining them into one line. Cheers, Xav
-- http://mail.python.org/mailman/listinfo/python-list