Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,182,038 members, 7,915,997 topics. Date: Friday, 09 August 2024 at 01:39 PM

Young02's Posts

Nairaland Forum / Young02's Profile / Young02's Posts

(1) (of 1 pages)

Programming / Re: Coding Challenge For Fun by young02(m): 5:49pm On Oct 15, 2017
efosky1246:


Bro this might work but it's quite inefficient.why looping thrice...

quite inefficient... see as u talk am self...
No be for FUN? tsk...

If point-and-kill is what u prefer, have it!

def counter(word):
word = list(word.lower())
for i in word:
if (i.isalpha()) or (i.isdigit()):
count = word.count(i)
if (count > 1):
print "{} ={}" %(i,count)
while(word.count(i) > 1):
word.remove(i)

that's all....
code attached...

Programming / Re: Coding Challenge For Fun by young02(m): 8:36am On Oct 14, 2017
solution in Python(2)
<code>
def counter(word):
numberList = [] # empty list for numbers
alphaList = [] # empty list for alphabets

#sorting num and alpha from word into resp. list
for ch in word:
if ch.isdigit():
numberList.append(ch)
elif ch.isalpha():
alphaList.append(ch.lower()) #converting to lower case since matching is case-INsensitive

#counting and print only num/alpha occurring more than once
for x in numberList:
count = numberList.count(x)
if count >1:
print "{} --> {} ".format(x,count)
while numberList.count(x) > 1 : #weeding tested num
numberList.remove(x)

for i in alphaList:
count = alphaList.count(i)and
if count > 1:
print" {} --> {}".format(i, count)
while alphaList.count(i) > 1: #weeding tested alpha
alphaList.remove(i)
</code>

call function with your string as argument e.g
counter("pEpper62532622"wink)
That's all... can download attachment or visit link below if code is not well formatted...

https://gist.github.com/nny326/93d34e5d63b023d17aa5fa4534a9fb4a#file-duplicatecounter-py

Technology Market / Re: Hp CQ56 Motherboard For Sale In Ph by young02(m): 4:24am On Sep 07, 2016
swiz2:
Fully functional cq56 motherboard for sale in ph. Call or whatsapp 08034330080
How much?
Technology Market / Re: Brand New Laptop Motherboard For Sale At Reduced Price by young02(m): 9:50pm On Sep 06, 2016
ruphytelecom:
Hp CQ56 motherboard is available call 08124461809

Still available? If yes, how much?

(1) (of 1 pages)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 7
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.