Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 9:14am On May 18, 2017 |
femigabe: I got an invite to write the test. but my question is, can I write the test little by little or I must complete it in one sweep once I start it? little by little or at once... just do as you wish but be certain to summit before deadline |
Education › Pls When Will Jamb Direct Entry Be Finally Out by phililp(op): 10:12pm On May 16, 2017 |
pls i looking up to sitting for the upcoming jamb de exam
i walk around the internet and see informations that says jamb DE form was out since 23 april but from jamb site it said not yet available
pls i really need more details about this.. dont wanna miss the train.
and beside can anyone recomment a good university to apply for?
am an NCE holder computer/maths.... wanna go for BSC computer science.
pls help me suggest ...thanks |
Programming › Re: My Python Guessing Game... Pythonistas Please Come In by phililp(op): 8:24am On May 16, 2017 |
kayoph: Philip, sorry i was just able to get my Pc on this night.... i Used python IDLE You might have fixed the problem some other way but I hope this clarifies my point. You should see the accessing of the dictionary using the: "if word in my_dict and my_dict[word] == item_describtion " i accessed the dictionary using the key. The key is the requested input. thanks man.. this also worked well... i appreciate ur support and concern |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 8:17am On May 16, 2017 |
r4blessing: But I applied for dis cycle and already preparing for it and I did not receive any mail like dat relax its gonno come |
Business › Re: I Want To Start A Recharg Card Printing Buisness... How Do I Start. by phililp(op): 10:29pm On May 15, 2017 |
jflexy: Think twice, go into vtu, it's better than recharge card printing... If you are interested in starting, contact me, commission is higher and start up cost is low. where i stay is a typical village.. no VTU here.. talk VTU and they be looking you like who take weed. its the voucher they know... anyway i can still bring development to'em sha... tell me how the VTU works |
Business › I Want To Start A Recharg Card Printing Buisness... How Do I Start. by phililp(op): 5:51pm On May 15, 2017 |
please due the hard bitting recesssion this days i want to get into this recharg card printing something like seriously
dunno if any of u is into it.. or can help me with how to get in touch with someone who is
really interested.
i have a laptop and ready to start |
Crime › Re: Co-tenant Slaps Nursing Mother To Death by phililp(m): 4:03pm On May 15, 2017 |
what ever that woman took i need 50 grams of it....
some poeple for 9ja dey Bleep up |
Programming › Re: What Is The Difference Between A Programmer And A Developer by phililp(m): 3:46pm On May 15, 2017 |
Mekzy02: @philip bro! When do u intend applying again? Working on the same thing! I am learning python immensely now! Buh I chave to finish my NYSC first before applying.. Would be going for batch B dis year! Lets link up if your not applying anytime soon! aiit bro! you can reach me on facebook: philips chikelinkedin: philips chikeor u can mail me E.mail: philipschike22@yahoo.com would love to meet you too as for the application.. i aint in a haste. would apply when i think am due. |
Romance › Re: by phililp(m): 11:41pm On May 14, 2017 |
FreeSpirited: fvck my life as how? see question.. she go Bleep ur life and Bleep ya destiny bro repent... bros |
Romance › Re: Rare Photo Of A Monkey, Trying To Mate With A Deer by phililp(m): 11:23pm On May 14, 2017 |
what ever that monkey took.... i need 50 kilos of it... |
Events › Re: Funny Dance Moves Of A Groom At His Wedding That Got Guests Laughing (Video) by phililp(m): 8:28pm On May 14, 2017 |
what ever that groom took... i need 50 kilos of it.
jizez kraist...
this is pure WBW(weed before wedding) |
Programming › Re: An Online Compiler, Interpreter And IDE For Nairaland by phililp(m): 8:21pm On May 14, 2017 |
Jenifa123: Dem go arrest u oh... Lol... Abeg free d guy lol.. dhtml abeg leave persin hand. e-CIA |
Programming › Re: My Python Guessing Game... Pythonistas Please Come In by phililp(op): 8:09pm On May 14, 2017 |
is it the weed i took last week that is still disturbing me or the fish brain section of my brain just climaxed..
lol! thanks bro..
but how come i cudint figure awt somthing as this so soon.... anyway thanks once again.... u just got me a certificate of GO AHEAD..
once again thanks to all of ya... i have also learnt more things from each comments... |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 7:01pm On May 14, 2017 |
femigabe: I'm really trying my best possible. pls is there any help or hint that can help me? the stuff looks very bulky, is there anything I should focus on?? the truth is.. if u've neva had a prior knowledge of programming or computer science.. then u might have to give up this phase of intake.. cos the time frame is too short.. to cover it... like i said its more than what you expecting. my advice is this: go home take your time study python and Js to a minimum of intermediate level..d if possible touch ruby a bit the rest in the home study curriculum ... is a piece of cake study the home curriculum now apply again it doesnt matter when you finish ... the application is there waiting for u u need more than u think to get there... cos if you just study a bit and with the help of friend bypass the proctor test.. then u would probably not find it possible to cope... u wont even be a match for the bootcamp.. though u should apply to see the nature of everything but like i said... u might not make it without what i said above. this is exactly what am doing now..... i started learning python about three weeks ago.. and now i have been able to solve most problems in the proctor test.. and i know i've gone far.... will be starting Js maybe next month good luck |
Programming › Re: My Python Guessing Game... Pythonistas Please Come In by phililp(op): 12:17am On May 14, 2017 |
fleshbone: Oh agreed!
That's why after the sleep (to cause a delay in seconds) The print(my_dict[item_description]) come to display the value of the random key.
Study the codes carefully again bro Phililp i have sir.. i think maybe u dont seem to understand the question... this is it.... each key in the dictionary is the name of the fruit...and the value of the key is the description of the fruit..so now.. item_describtion = random.choice(my_dict.values())... #this will return a random value(description of any randomly selected fruit) print (item_description) #prints the returned value/description and not the key.. then now in the while loop... we wana check to see if the user's input is same as the key of that printed value/description so if u say... if user_input == item description: # this is wrong because it will rather check to see if user's input is == item_description# which was = a random selected value and not key.... but our aim is to check if the user's input is the key to the printed value... so i dont know how to implement this.. i tried using if user_input == item_describtion.key()# but this will give an attribut error cos key is not an attribute of a dictionary ... but keys() is.. which implies the whole keys in that dictionary.. but if we again say: if user_input in my_dict : # this will run well but cause a (the hell do you call that error again..) .. yas!! SEMANTIC ERROR.. because say the description of apple was printed and the user inputs mango .... it will accept as tru cos mango is in my_dict. hope understand ... so now thats my pain in the butt.. how to check if the user's input is == the key of that very printed description.. .. thanks to the house BTW.. am enjoying this thread. |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 11:30pm On May 13, 2017 |
femigabe: Thanks a bunch hope u've studied up to expectation.... the home study might not be as simple as u might expect |
Programming › Re: My Python Guessing Game... Pythonistas Please Come In by phililp(op): 12:38pm On May 13, 2017 |
fleshbone: silento is right bro!!!
Here's what i did with my 2.7 though and it worked perfectly. go through it and i hope you get the best out of it.
import random from time import time,sleep
my_dict = dict()
my_dict['mango'] = '''green when unripe and yellow when riped.. has one seed. hipogeal type seed germination'''
my_dict['apple'] = '''Look kinda speriacl... has many seeds. looks green when unripe; some looks red some yellow some still green'''
print('I will describe the fruit and you will say its name')
item_description = random.choice(my_dict.keys())
sleep(1)
print(my_dict[item_description])
chances = 5
my_guess =''
while True: ---if chances != 0: ------print('Enter your Guess') ------user_guess = (raw_input()) ------if user_guess == item_description: ---------print ('correct! you only used', 6 - chances, 'chance')
---------break ------else: ---------chances -= 1 ---------print ('Sorry, try again. You have', chances, 'chances left') ---else: ------print('Sorry, you\'ve run out of chances to guess. yor have', 0, 'guesses left')
------break
----------------------------------------------------------------------------------------------------------------
best of luck phililp boss
meanwhile, dont forget that when you have a chance left, it should be "1 chances left". thanks sir... but this wont produce the required result.. because .. item_description = random.choice(my_dict.key()) so if you print item_description the output would be a random selected key... not its value dunno what the sleep does though.. |
Programming › Re: My Python Guessing Game... Pythonistas Please Come In by phililp(op): 12:32pm On May 13, 2017 |
silento: do I look like a joker to you
the fix to the error in you code
the time I was learning python I figured every thing out my self
do you want to test what you have learnt so far
build a gui lover calculator
tkinter for gui
flame game type
goodluck thanks bro! i will try it.. started learning three weeks ago, dont know about GUI yet... but with time i definitely will.. thanks for the hint... |
Programming › Re: My Python Guessing Game... Pythonistas Please Come In by phililp(op): 11:28pm On May 12, 2017 |
silento: here is the solution
not values()
but. keys() bruv! is this some kinda joke?? |
Programming › Re: My Python Guessing Game... Pythonistas Please Come In by phililp(op): 9:20pm On May 12, 2017 |
4kings: They're just loop variables that are useful for iteration.
>>>for x in range(3): print(x) #the result will be 0, 1, 2 x is the variable in this loop iteration. You know that range of 3 is 0,1 and 2 Therefore x represent each value in the range in the course of the iteration.
However a dictionary(or the dictionary items) is like a tuple of two values: ('keys' and 'values') and not made of just a single value like the range. So i used two loop variables for the dictionary to represent the keys and values which in this context are your fruits and description
I hope i explained this well. crystal clear sir.. i will build on it. |
Programming › Re: My Python Guessing Game... Pythonistas Please Come In by phililp(op): 11:30am On May 12, 2017 |
4kings: my_dict.values() returns a string and not a dictionary. Therefore using item_description.key() is also the same as doing 'string'.key() and key is not an attribute of a string. For example: >>> name = 'seun' >>>name.key() pythons return error message because 'key' is not an attribute of a string.
So to solve your problem, do this instead:
for fruit, details in my_dict.items(): if word == item_describtion: print('you got it') break
I hope you know what items() does, so i don't need to explain that. If you don't you can quote me. yea i know the my_dictionary.items () returns the key and value of each item in the dictionary.. but i dont understand what the for fruit, details in ... does |
Programming › Re: Learn Python- Introduction To Programming by phililp(m): 11:34pm On May 11, 2017 |
pls someone help... whats the difference between mutable and immutable in python..
a detailed explanation will be highly appreciated
thanks |
Programming › Re: My Python Guessing Game... Pythonistas Please Come In by phililp(op): 10:52pm On May 11, 2017 |
kayoph: Philip.. I'm sorry I won't be able to send a screen shot this night.. I just got back to my area in Ogun, nd I heard that Nepa hasn't been our friend for weeks now..I mean my pc is down. anyways I've read through the comments and I can see suggestions about using the .value() : let me share what I think : 1) dictionary.values() (that's if you are using python 2 which I think it's obsolete for anyone to be using that now) 2.) list(dictionary.values()) ( that's in python 3)
A dictionary in python works like a real dictionary in real life (the Longman, Oxford. etc.). Like I said earlier a dictionary has a key and a description. So you can only access the contents of a dictionary via its key just like you can search up the meaning of a word using the word-name in a dictionary. Now using the either of the ways I listed above is only going to give you a list of your dictionary.. let's take for example :
dict = {"Name": "Philip", " Age": 7} d = {"Philip" : "A young boy of age seven "}
Print(list(dict.values())) will give you : Value : ['7' 'Philip' ] ( or Value :['Philip' '7']... I'm not sure but either of the two will be produced I could have run it now but my pc can't rescue me now).
Print(list(d.values())) will give you: Value : ['Philip' 'A young boy of age seven']
This simply gives you a return of view of the dictionary’s values instead ( I think a G mentioned it also) and I believe that's not what you are looking for... thanks.. i think with this i can solve may first problem.. but now how do i check to see if the users input is the key of the random selected value.. i.e if user_input == items_description's key print ('you got it) # where item_description = random.choice(list(my_dict.value())) please how do i implement this |
Programming › Re: What Is The Difference Between A Programmer And A Developer by phililp(m): 8:42pm On May 11, 2017 |
ijeezlux: thanks bro.... may God make you bigger. please tell me more about this andela. in a nutshell; if your good in programming; you can apply.. they give you a home study text.. u study and then they send a text.. if you pass... u attend a bootcamp.. where they select the best participants.. it is based in python PL... i applied but cudnt make it.. so now am taking my time to stludy python getting set for it... Andela is a dream come true. click on this link to read more.. https://andela.com/apply/ they train you to become a world class developer and then pay while they train you... you intern with them for four years |
Programming › Re: What Is The Difference Between A Programmer And A Developer by phililp(m): 5:56pm On May 11, 2017 |
ijeezlux: I was onces very active in programming, using c++ to solve problems. but these days because of how naija is I have almost forgotten what even a variable is in programming. what a sad story, well I put the blame on Nigeria's dilapidated stated. even my laptop is no where to be found. I sold it long ago when the going was very tough. so what I do these days to make ends meet is not in any way related to computer, let alone programming. wetin man go do na. I must survive. when I see and hear young people talking about coding... I feel very bad. but God knows y everything is like this. but these days I still imagine code... I still think code... I still write code in my imaginary world. am even having that feeling that am better than i was before when I was coding with my laptop, I feel am now like an old wine that get better with time. ... so of late am now trying to use my little chinco phone to learn a more marketable(Nigeria) language (php and JavaScript).. but do u know what? I don't really have the zeal to learn them cos I feel they are too easy and that they don't pose any challenge to me. if coding is what you love and dream of; then dont let it die bro... i like the fact that you still live with and dream codes... so; comming from me i'd say dont give up on it; just keep the spirit. you can apply for andela if u wish... can help catch ur dreams.. goodluck |
Programming › Re: My Python Guessing Game... Pythonistas Please Come In by phililp(op): 4:20pm On May 11, 2017 |
kayoph: I Philip, I'm not a pro actually but I do understand how python works.... I noticed your dictionary, and your trying to random choose from it.. N.B a dictionary has a "key" and a "value ". You can only access a dictionary via its key. so it ought to be :
Although you could make your description a key and your key a description.. But that isn't conventional and other programmers reading your code might have hard time. I'll rather you use a tuple / a list for this kind of game you are trying to build. Because you intended this: print('I will describe the fruit and you will say its name') Having a parameter for your values using something like this y = (fruit = apple, description = " blah, blah blah " Then print description For description in y print:..... . then ask the player to enter the key If key = apple : then score += 1 else: score -= 0 if score <= 0: score = 0 I could Ave done it n send it to you now but I'm in a bus travelling.. Hopefully when I get home I'll send a detailed version.. The things I wrote above are in pseudocode so just follow it.. if you don't get it still drop a reply but I post a detailed answer when I get home. There are interesting ways to draw up games like this . I hope I get time to show you how they work later thanks a lot kayoph for taking ur time to help me... well i would like you to still give be details when you go home. but for the main time; i will try working with this ur pseudo code.. thanks meanwhile... save journeys |
Programming › My Python Guessing Game... Pythonistas Please Come In by phililp(op): 11:40am On May 11, 2017 |
dear pythonistas. a newbie in python. am trying to make a game that describes a fruit and the user try to guess the name of the fruit
but am having som errors i dont understand.. here is my code
import random
my_dict = {"mango": "green when unripe and yellow when riped.. has one seed. hipogeal type of seed germnation", "apple": "look kinda sperical.. has many seeds. look green when unripe. and when riped; some looks red some yellow some still green"}
print('I will describe the fruit and you will say its name') item_describtion = random.choice(my_dict.values())
chances=5
print ('you have 5 chance for the guess')
print (item_describtion)
while chances > 0: word = str(input( 'what is the name:')) chances -=1 if word == item_describtion.key(): print('you got it') break
else: print (' try again') if chances == 0: print('sorry used ur five chaces') break
print ('you have', chances, 'chance left')
print ('the end')
i know the error in comming from trying to get random.choice of the dictionary because i used a list implace of the dictionary and it ran well.. so the real probem is[b] how to get a random value from a dictionary[/b]
and how to check if user's input is == key of the random item picked
please help me acheive this.. thanks
this is the error i get
|
Romance › Re: There Is Nothing To Gain From Being A Good Person.. by phililp(m): 10:21am On May 11, 2017 |
boynigeria: my dear....life is abt ur status of happiness. dont do thinks because they work or they dont. do things cos they make u comfortable and happy to do
if been good is who u are, forcing urself to be otherwise could bring terrible result i azmire ur intellect |
Nairaland General › Re: What Is The Best Piece Of Advice You've Received? by phililp(m): 11:12pm On May 10, 2017 |
skillz111: My son with patience you can achieve all things if you think patient is a good virtue try using 1.5G sim speed in you android phone. |
Romance › Re: Boy Raped By Gay, Is He Morally Wrong To Marry A Woman ? by phililp(m): 10:56pm On May 10, 2017 |
whywhyogun: there are so many rape cases in Nigeria, and there are no social workers' hotline in Nigeria.
this thread could be a small window for those victims to know, they are not alone, they are concerned.
because, the victims' minds are complicated, they wish to marry , to have a family , to forget the past. but, they physically and mentally can not fulfill this task somehow.
I guess there are 1 million rape victims in Nigeria. they are left alone, by callous , selfish and stupid people , like you. ewu awusa.. gay rape cases. get sense for once bro go there with your yeye story; go there you will see thunder; ask it to fire you..
|
Romance › Re: Boy Raped By Gay, Is He Morally Wrong To Marry A Woman ? by phililp(m): 6:37pm On May 10, 2017 |
whywhyogun: concerning black men, there is a saying "once black ,never back" ; concerning husband-and-wife, in Japan(by the way, I am not a Japanese), there is "once husband-and-wife, forever husband-and-wife" .
rape is a bad thing, gay rape could be worse. however ,
1) a boy, younger than 15 years old, can not shape his sex orientation yet. a gay could help him to shift and settle to be a gay. if he grows up to 25 , and is forced to marry a girl , it could be a worse sin to him. for he loves men only.
2) everyone who has sex experience (I mean going inside the hole), would understand, at that moment, no matter by what way, both parties are experiencing true love. what makes rape a bad thing ? it is because, in a rape, such a true love will end within 2 minutes , not because rape causes pain or any other superficial reasons.
3) in another word, if rapist can marry the "victim", true love will succeed. rape could be a good thing. it denotes the passion and gallantry, which have been eulogized by so many poems and novels.
4) sometimes I even think, polygamy is a good thing too. it gives men's passion a legalized way to deal with.
5) back to the point : even during the gay rape, there is true love. and human beings are supposed to have 1 true love in their life time. how can a boy, who gives his true love to a gay rapist, will marry a girl when he is a grown-up ?
6) that boy's hole belongs to the rapist forever .
7) that boy is suspected to be potentially a gay, and he is not suitable to have a female wife.
a man being used and to use another body, this is disgusting .
9) what will that girl think, if she knows he has been used by a gay ?
10) although that boy has not been indentured to that rapist by a piece of <marriage certificate> , they(the boy and the rapist) are indentured by God, when that motion and thrust is being on. this sensless gay been posting senseless bullshits on NL... last time i checked s/he was looking for a fellow gay in NL with a big dick.. guy.. mature yes... i mean ....receive sense. |
Nairaland General › Re: What Is The Best Piece Of Advice You've Received? by phililp(m): 6:22pm On May 10, 2017 |
the only thing we do in life is: wake up in the morning and try to survive till the next so just dont fvcking worry about no shiit..
leave ur life to the fullest but while you do... have reverence for Jah.. |