Python Forum
The int that appears an odd number of times.
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The int that appears an odd number of times.
#3
i did with dictionary
a = [1,2,3,2,4,2,4,3,5,5,1]
result = dict((i, a.count(i)) for i in a)
print result
I just got the counts but how to print only the int that appears an odd no of times
Output:
{1: 2, 2: 3, 3: 2, 4: 2, 5: 2}
Reply


Messages In This Thread
RE: The int that appears an odd number of times. - by MeeranRizvi - Dec-30-2016, 06:36 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  times greater number than the previous rhai 4 3,506 Oct-08-2018, 03:27 AM
Last Post: woooee
  when I type either C B or A nothing appears Samp97 3 2,852 Aug-15-2018, 06:36 AM
Last Post: DuaneJack
  Find how many times a user played an artist and how many times disruptfwd8 1 2,633 May-04-2018, 08:32 AM
Last Post: killerrex
  Search for Player ID and return games played and number of times disruptfwd8 3 3,468 May-03-2018, 06:45 PM
Last Post: disruptfwd8

Forum Jump:

User Panel Messages

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