Python Forum
Print the number of items in a list on ubuntu terminal
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print the number of items in a list on ubuntu terminal
#1
Hey all.
In return of a command, I have the following output on my ubuntu terminal.
Output:
tshark: Display filters were specified both with "-Y" and with additional command-line arguments. 21 List of ARFCNs = 62 53 List of ARFCNs = 62 60 58 57 55 54 53 52 51 50 49 25
I want a python code that prints the number of entries in the first list i.e. 2.
Please help.
Reply
#2
what have you tried so far?
Please show code working or not
Reply
#3
Why Python? Why not just a shell pipeline with say, AWK (other tools are probably also suitable)? Is your goal to learn Python?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Sum of list items tristanfermat 2 241 Feb-06-2021, 12:04 PM
Last Post: tristanfermat
  print two different sequence number mantonegro 2 210 Nov-16-2020, 06:19 PM
Last Post: mantonegro
  Count number of occurrences of list items in list of tuples t4keheart 1 249 Nov-03-2020, 05:37 AM
Last Post: deanhystad
  How do I add a number to every item in a list? john316 2 216 Oct-28-2020, 05:29 PM
Last Post: deanhystad
  concatenating 2 items at a time in a python list K11 3 295 Oct-21-2020, 09:34 AM
Last Post: buran
  Print max numbers in a list jimmoriarty 1 313 Sep-25-2020, 07:29 AM
Last Post: DPaul
  Select the other of 2 items in a list Clunk_Head 7 621 Sep-01-2020, 05:27 PM
Last Post: Clunk_Head
  Print variable values from a list of variables xnightwingx 3 450 Sep-01-2020, 02:56 PM
Last Post: deanhystad
  Removing items from list if containing a substring pythonnewbie138 2 463 Aug-27-2020, 10:20 PM
Last Post: pythonnewbie138
  Beginner Code, how to print something after a number of turns (guessing game) QTPi 4 532 Jun-18-2020, 04:59 PM
Last Post: QTPi

Forum Jump:

User Panel Messages

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