Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
question by a beginner
#12
(Jan-27-2019, 06:58 PM)salahoum Wrote: I explained my problem but the idea did not arrive
I simply re-explain
the videos in YouTube they read the data from the csv file like:

name, age, number, and the date; Salah; 22; 1; 26/01; ali; 23; 2; 26/01; Ranard; 30; 3; 26/01

I need to display it as:

name number date
salah 22 1 1/26
ali 23 2 26/01
ranard 30 3 26/01

There are three column headers (name, number, date) but four data columns separated by tab. Is it typo? What does mean 'display'? Is there one long row or data is on separate rows?

Based on limited knowledge a would propose something along those lines:

>>> s = ['name; age; number; date',
...      'Salah; 22; 1; 26/01',
...      'ali; 23; 2; 26/01',
...      'Ranard; 30; 3; 26/01']
>>> for row in s:
...     print(*row.split(';'))
name  age  number  date
Salah  22  1  26/01
ali  23  2  26/01
Ranard  30  3  26/01
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
question by a beginner - by salahoum - Jan-15-2019, 08:46 AM
RE: question by a beginner - by j.crater - Jan-15-2019, 09:23 AM
RE: question by a beginner - by salahoum - Jan-15-2019, 09:53 AM
RE: question by a beginner - by j.crater - Jan-15-2019, 11:25 PM
RE: question by a beginner - by salahoum - Jan-16-2019, 10:40 AM
RE: question by a beginner - by ichabod801 - Jan-15-2019, 11:48 PM
RE: question by a beginner - by salahoum - Jan-16-2019, 08:11 AM
RE: question by a beginner - by salahoum - Jan-26-2019, 05:59 PM
RE: question by a beginner - by snippsat - Jan-26-2019, 06:17 PM
RE: question by a beginner - by salahoum - Jan-27-2019, 06:58 PM
RE: question by a beginner - by perfringo - Jan-28-2019, 12:02 PM
RE: question by a beginner - by snippsat - Jan-28-2019, 01:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Very Beginner question on simple variables Harvy 1 158 Apr-12-2024, 12:03 AM
Last Post: deanhystad
  A simple "If...Else" question from a beginner Serena2022 6 1,681 Jul-11-2022, 05:59 AM
Last Post: Serena2022
Question Beginner Boolean question [Guessing game] TKB 4 2,280 Mar-22-2022, 05:34 PM
Last Post: deanhystad
  Beginner question NameError amazing_python 6 2,429 Aug-13-2021, 07:28 AM
Last Post: amazing_python
  Beginner question - storing values cybertron2 4 3,173 Mar-09-2021, 04:21 AM
Last Post: deanhystad
  beginner question about lists and functions sudonym3 5 2,708 Oct-17-2020, 12:31 AM
Last Post: perfringo
  beginner question ___ 1 1,724 Jul-12-2020, 08:12 AM
Last Post: Gribouillis
  Beginner question: lxml's findall in an xml namespace aecklers 0 2,894 Jan-22-2020, 10:53 AM
Last Post: aecklers
  Super easy beginner question AkulaLA 3 3,235 Nov-07-2019, 03:42 AM
Last Post: Larz60+
  Basic Beginner question NHeav 4 2,748 Sep-13-2019, 11:43 AM
Last Post: NHeav

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020