Handling Problems in Python

Solutions to problems faced by new Python-users

Monday, 4 February 2013

Multiple inputs in one line in Python

import re
array=[]
string = raw_input()
temp = re.sub("[^\w]", " ", string).split()
for element in temp:
    array.append(int(element))
    print element               
Posted by Coding man at 11:59 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Blog Archive

  • ▼  2013 (10)
    • ▼  October (8)
      • Write short codes in Python - Part 5
      • Why my python code is not working
      • Shortest Code to Detect Rotated Strings in Python
      • Shortest Magic Square Generator code in Python
      • Write short codes in Python - Part 4
      • Write short codes in Python - Part 3
      • Write short codes in Python - Part 2
      • Write short codes in Python - Part 1
    • ►  February (2)

About Me

Coding man
View my complete profile
Simple theme. Powered by Blogger.