Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,143,155 members, 7,780,114 topics. Date: Thursday, 28 March 2024 at 09:50 AM

Pls Help With Python Problem - Programming (3) - Nairaland

Nairaland Forum / Science/Technology / Programming / Pls Help With Python Problem (6828 Views)

I Need HELP With This Python Problem / Build A Bare Bones Reddit Clone With Python And Flask (hands On Tutorial Thread) / Help With This Python Problem (2) (3) (4)

(1) (2) (3) (4) (Reply) (Go Down)

Re: Pls Help With Python Problem by bright007(f): 11:53pm On Aug 08, 2013
Hi pheno,you must be very busy these days.pls spare a little out of your time this weekend to help me out.
thanks a million times
Re: Pls Help With Python Problem by bright007(f): 7:53pm On Aug 09, 2013
if you havnt got enough data to post the correction,pls let me know in your next post.
Re: Pls Help With Python Problem by bright007(f): 8:58am On Aug 10, 2013
smiley smiley smiley
Re: Pls Help With Python Problem by Nobody: 6:12pm On Aug 10, 2013
I am just out to enjoy the holiday. No programming for me until next week. wink
Cheers.
Re: Pls Help With Python Problem by bright007(f): 6:33pm On Aug 10, 2013
PhenomenonVFX: I am just out to enjoy the holiday. No programming for me until next week. wink
Cheers.
okies...boss.Have a nice time.

In the meantime,i will be posting some difficulties which i cant seem to address myself.
pls do find time to help me out on them.
Re: Pls Help With Python Problem by Nobody: 3:37pm On Aug 11, 2013
bright007: okies...boss.Have a nice time.

In the meantime,i will be posting some difficulties which i cant seem to address myself.
pls do find time to help me out on them.

Feel free to do so. smiley
Re: Pls Help With Python Problem by bright007(f): 5:24pm On Aug 11, 2013
i would like you to help me with these corrections.
(1)the current program supports the conditions below
(a)if number and position are specified
(b)if only number is specified
(c)if only N is specified
pls help me write for:
(a)if only position (P) and N is specified

(2)the program only return one result per number.sometimes a number can satisfy the conditions specified more than once.pls help me modify the program so that if a number satisfies d conditions more than once,it returns all results and not just only the first result.
(3)the condition P (position) should be modified thus:
if P is specified,P (input) should only refer to the second set where a condition is met e.g
set1=12 13 14
set2=18 45 16
set3=17 12 54
set4=22 16 32
if i input P=1 and N=1,it should return set1,set3 for 12 and set2,set4 for 16 according to the data above.
Re: Pls Help With Python Problem by bright007(f): 4:48pm On Aug 12, 2013
@pheno:pls add this to the previous kwession.
define lapping (x1,x2)
x1 and x2 are any two numbers in the program.
the relationship between x1 and x2 is that x2 occurs immediately x1 occurs in the same position but in different set. e.g
set1= 12 13 14
set2= 45 11 16
set3= 69 89 82
set4= 14 12 13
set5= 42 45 11
if i input x1=12 and x2=45,the program returns set1,set2 and set4,set5. #this is because 12 which occurs in set1,position 0 is immediately followed by 45 in set2 position 0,in set4,12 also occurs in position 1 and is followed by 45 in position 1 in set5
if i input x1=13 and x2=11,the program returns set1,set2 and set4,set5.
but if input x1=16 and x2=89,the program returns not available.
although 16 occurs in set2 and 89 in set3,their position differs. i.e 16 occurs in postion 2, set2 and 89 in position 1, set3#
Re: Pls Help With Python Problem by Nobody: 3:01pm On Aug 13, 2013
Hi. Been quite busy. I dont know how free I will be before the weekend but whenever I am, I will try to work on the above problem. I get the last problem about the lapping function. It is very easy to do. What I dont get is the question before the last; the modification u requested.

Furthermore, I think the essence of these programs is for u to learn. If u are able to read and fathom the codes I sent u, u should be able to tweak or reverse engineer, so to speak, the functions to achieve what u want. I want to make sure u are actually learning something so that this doesnt become the first salvo in a series of never-ending code requests. Apropos, in the future, I may be following a different guideline altogether in solving ur code problems. I may resort to giving u helpful tips only, forcing u to avail of the wealth of knowledge in books, devise solutions with cheer ingenuity and improve at a faster pace. That is how I learnt albeit without the tips.
Cheers. wink
Re: Pls Help With Python Problem by bright007(f): 3:32pm On Aug 13, 2013
ok...boss .its ok to guide me through solving the problems but i still got a lot of learning to do and i seem to learn better when reading the codes.
i will post the last problem again and make it more clear.
Re: Pls Help With Python Problem by bright007(f): 5:44pm On Aug 13, 2013
(1)the first modification is a recursion exercise. e.g
set1=12 18 26
set2=64 31 72
set3=18 73 65
set4=20 26 33
set5=38 82 22
set6=65 26 18
set7=24 48 31
set8=18 25 78
set9=26 50 41
if i input N=2,X=26,the program as it is now will return only set1 and set4 but if u observe,that is not the only sets that match N=2,X=26.set6 and set9 also satisfy N=2,X=26.
also if i input X=18,N=1
The program as it is now will only return set1,set3 but dis condition is also satisfied by set6,set8.
(2) i want the current program to support specifying ONLY P and N as condition. i.e if i chose not to specify x,
the program should return results using only P and N as condition.
(3)the third modification is about how the condition P works.
from d data above,if i input N=2,X=26 and P=1,the program should return set1,set4 ONLY but if i input X=26, N=2,P=0, the program returns only set6 and set9.
dis means condition P only refers to the latter set where item X reoccurs.
in d e.g above,P=1 in set6 .In e.g two P=0,set9
Re: Pls Help With Python Problem by bright007(f): 5:49pm On Aug 15, 2013
checking...
Re: Pls Help With Python Problem by bright007(f): 6:28pm On Aug 16, 2013
@pheno...pls boss,i will be expecting your reply this weekend.pls help a learner....i have really tried all my best trying to solve this excercise but not yielding the correct results.
Re: Pls Help With Python Problem by bright007(f): 4:10pm On Aug 18, 2013
Re: Pls Help With Python Problem by Nobody: 9:14am On Aug 19, 2013
LOL. I am very sorry. I traveled and my computer is not with me. I am using my phone right now. I will get back to u. But I am usually very busy. So I cant promise u. But if I do find the time I will do it.
Re: Pls Help With Python Problem by Nobody: 9:22am On Aug 19, 2013
bright007: (1)the first modification is a recursion exercise. e.g
set1=12 18 26
set2=64 31 72
set3=18 73 65
set4=20 26 33
set5=38 82 22
set6=65 26 18
set7=24 48 31
set8=18 25 78
set9=26 50 41
if i input N=2,X=26,the program as it is now will return only set1 and set4 but if u observe,that is not the only sets that match N=2,X=26.set6 and set9 also satisfy N=2,X=26.
also if i input X=18,N=1
The program as it is now will only return set1,set3 but dis condition is also satisfied by set6,set8.
(2) i want the current program to support specifying ONLY P and N as condition. i.e if i chose not to specify x,
the program should return results using only P and N as condition.
(3)the third modification is about how the condition P works.
from d data above,if i input N=2,X=26 and P=1,the program should return set1,set4 ONLY but if i input X=26, N=2,P=0, the program returns only set6 and set9.
dis means condition P only refers to the latter set where item X reoccurs.

in d e.g above,P=1 in set6 .In e.g two P=0,set9

Just restudied the above. The bolded is freaking confusing. Also hope u arent the person trying to PM me. I usually dont reply PMs. Once the powers that be afford me the opportunity I will do this problem as best as I can understand it. It will require a lot of reworking the original code. And I have a point of not doing anything in my resting time.
Ciao.
Re: Pls Help With Python Problem by bright007(f): 9:58am On Aug 19, 2013
okies boss....how was/is the trip? hope everything is working perfectly as planned?...
as for PMs,i didnt send them.
i will be waiting patiently for your reply.
Re: Pls Help With Python Problem by bright007(f): 10:53am On Aug 19, 2013
set1=12 26 18
set2=64 31 72
set3=18 73 22
set4=20 26 33
set5=38 82 22
set6=18 24 17
set7=31 48 32
set8=18 26 78

(3)the third modification is about how P works.
as d program is now if u input N=4, P=0,it will return 18,set3:set8 meaning the item that satisfies P must be in the same position in the 2 sets returned by the program which in this example,18 is in position 0 in set3 & position 0 in set8.
the modification is that P should only refer to position of the item in the second set which in this example is position 0 in set8.
hence if u input N=4 & P=0,the program should return X=18,set3:set8,X=18 (18 satisfies d condition twice),set1:set6 & X=31,set2,set7.
the connecting factor is that:
(first result)18 satisfies N=4 & its position in set6(2nd set) is 0.
(2nd result)18 also satisfies N=4 & also its position in set8(2nd set) is 0.
31 also satisfies N=4,& its position in set7(2nd set) is 0.
Re: Pls Help With Python Problem by Nobody: 6:02pm On Aug 19, 2013
Ok. So I downloaded the program I sent u and edited it on a friend's laptop. He doesnt have python installed so I didnt run the program. Be adviced that there might be a lot of errors in this one.
I have added the lapping function and minor tweaks that should make the functions do what u want.
I didnt do the position function u want. I want to use it as a test of ur knowledge. Since u say u learn by reading codes, u should be able to read the code, modify it and come up with a solution. It is just the same as the one with N and x alone. Only make it work it p instead of x and change some stuff in the function to get it working.
Let me know if something in the code I attached to this one isnt working right.
smiley cheers

Re: Pls Help With Python Problem by bright007(f): 10:18pm On Aug 19, 2013
oh my! python is not as easy as it seem.
thanks very much for your quickie reply despite your busy schedule.
i just downloded and ran it on python 2.7.3 as it was returning error in python 3.3.2
well,the program wasnt returning expected results as per the modification requested.
# it was still returning one results per item even if the item sastisfies the condition more than once, also the lapping was not functioning as well #was always repeating a particular set even if the condition changes. Condition P was still the way it works,wasnt flexible like i explained.

Like you said,i will try to write the N and P function myself and will possibly post it here after success.
But i will like you to help check the program again for the correct solutions.i know code-writing takes time and a lot of brain power.
just help me re-visit the problem once more and i will be ok.# no more disturbing you for codes#.....
thanks once again for your kind gesture.cheesycheesycheesycheesy
Re: Pls Help With Python Problem by bright007(f): 10:39am On Aug 23, 2013
@pheno.....pls remember me in your busy timetable.
i am still counting on you this weekend.
Re: Pls Help With Python Problem by bright007(f): 6:26am On Aug 29, 2013
@pheno: you have forgotten about your pupil!....
i have been able to solve the problems with the help of a friend.
Just remaining only the lapping function which seems to be difficult.
pls,if you can still help me with it, i will appreciate,thanks.
Re: Pls Help With Python Problem by Nobody: 7:31am On Aug 31, 2013
Hi. The lapping function is in the file I sent u last. Check it again.
Re: Pls Help With Python Problem by bright007(f): 2:35pm On Aug 31, 2013
hi dear, i downloaded it again and the lapping function hasnt changed.
i hope the hidden post above is not yours.(thinking maybe thats where the modified lapping function is),

my inability to create the lapping function has hindered my progress.
the next exercise was for me to integrate the lapping function with the turn function.
pls, even if the lapping function is the last exercise you will solve for me,just help do it.
thanks.
Re: Pls Help With Python Problem by Nobody: 4:50pm On Aug 31, 2013
What exactly is the lapping function supposed to do? Explain again. Clearly. smiley
Re: Pls Help With Python Problem by bright007(f): 7:40pm On Aug 31, 2013
PhenomenonVFX: What exactly is the lapping function supposed to do? Explain again. Clearly. smiley
ok.,,
set1=35 36 17
set2=88 41 20
set3=24 49 11
set4=61 35 42
set5=64 88 48
set6=54 55 81
set7=35 12 41
set8=61 88 49

from the data above
if u input lets say x1=35
and x2=88...then the lapping function should return set1:set2 and set4:set5.(where 35 and 89 actually laps each other)
note that 35 is in set7 and 88 is in set8 but they donot lap,so the function does not include it in the result.
also if you input x1=41 and x2=49,the lapping functon returns set2:set3 and set7:set8.

so basically if x1 is in set1 then x2 must be in set2 (no spaces between the two sets)
if x1 is in set500 then x2 must be in set501.

do you know that i was stock for four days when trying to write my own modification just because i wrote 'Big_set' instead of 'Big_Set'.python was just returning name 'Big_set' not defined anytime i ran the program.thank God i finally saw my mistake.
gringringrincheesycheesy
Re: Pls Help With Python Problem by bright007(f): 7:41pm On Aug 31, 2013
PhenomenonVFX: What exactly is the lapping function supposed to do? Explain again. Clearly. smiley
Re: Pls Help With Python Problem by Nobody: 2:10pm On Sep 01, 2013
LOL. 4 days? Wow. At least u have gotten an experience. U cant make such mistake again. Next time make sure u follow the exceptions thrown by the python interpreter.
Anyway the last code I sent u should be able to do what u requested. But I will check and make any needed corrections later.
Re: Pls Help With Python Problem by bright007(f): 4:47pm On Sep 01, 2013
hi pheno,i have tried it.
its not working fine.
it was always returning set2 in all its results.
pls help me check it.
Re: Pls Help With Python Problem by bright007(f): 10:16am On Sep 06, 2013
PhenomenonVFX: LOL. 4 days? Wow. At least u have gotten an experience. U cant make such mistake again. Next time make sure u follow the exceptions thrown by the python interpreter.
Anyway the last code I sent u should be able to do what u requested. But I will check and make any needed corrections later.
....boss,still waiting ooo.
Re: Pls Help With Python Problem by bright007(f): 9:18am On Sep 07, 2013
boss,pls find time to help me check the solution this weekend,thank you.

(1) (2) (3) (4) (Reply)

Criticism Of Object Oriented Programming / Outlook PST Recovery Software ? / Whot! Game For Android Phones

(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. 50
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.