Jump to content
Matei

Intrebare Python

Recommended Posts

Posted (edited)

Am o problema ... nu stiu cum sa fac in python urmatoarea chestie :

Se citeste de la stdin un fisier gen :

x y

1 2

3 4

5 6

Eu trebuie sa fac niste chestii cu numerele astea ... dar nu stiu cum sa citesc doar x-urile si dupa, doar y-urile :).

Punctele astea sunt coordonate pentru ceva , dar nu inteleg cum as putea sa le citesc pe rand :)

O idee ceva, va rog ?

In c mi se pare simplu, in python nu inteleg deloc :))

Later Edit :

Am ajuns la chestia asta cu line.split () :

['1', '2']

['3', '3']

['3', '4']

mai departe ?

Edited by Matei

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...