Bright007's Posts
Nairaland Forum › Bright007's Profile › Bright007's Posts
1 2 3 4 5 6 7 8 ... 63 64 65 66 67 68 69 70 71 (of 184 pages)
representing team [color=yellow]learn python[/color] |
yes...legrover..new edition. do you dig? |
most comments so far on this incidence are guilty of fallacy. after reading the story,i can understand that the man didnt kill his wife because of the death of the snake,rather it was the quarrel resulting from the incident that led to more arguments which later led to his unfortunate action.simply put the woman's death could have been averted with wisdom on the woman's side.she was probably defending the child and and this infuriated the man to beat her,not knowing that it would result in her death. that doesnt mean am in support of the man's action as i strongly believe that there is no genuine excuse for wife battery. |
khattab02: Must u start spreading lies, false accussation and blashpemism?what lies and false accustion?...have you forgotten your virgin-seeking yerima who is proud of replicating the ctions of that 9-year old molester you call your prophet?...the worst part is that the single reason for killing these innocent people is to become entitled to virgins! |
no...dumb kwession! is your father's brain working? |
virgin-searching islamists are on rampage again. muslims in power are using the law to claim virgins here on earth while the common muslims are using bombs to claim virgins in mohammed's heaven. smh! |
PhenomenonVFX: OP. I am thru with ur code. It is just remaining to make it cleaner and more readable for u and to add a lot of comments that tries to explain stuff. I will finish that once I am free later tonite so u should see the code by 2moro. It is a lenghty code, I must warn ya. And as much as I have tried to make it simple, u would need a good understanding of Python's data structures like tuples and lists to grasp it totally.thanks boss...i am waiting patiently. |
@pheno:just checked if you have posted the code.if you dont still get it let me know. |
also (1)if x is not specified and p is not specified,the program returns any number that satisfies the argument N as well as the set where the number re-occurs.else it returns "not available" (2)if x and p are specified,the program will not return x #since it's already specified# but will return the set where x re-occurs . (3)if x is specified and p is not, the program returns the set where x has re-occured ## N is a condition that must be met. else it returns "not available" (4)generally,if any argument is specified,it becomes obligatory for the program to return the results that satisfies the condition,else it returns"not available" |
thanks boss...let me answer d kwessions: (1)the function takes 3 inputs. (a) x is any number in the data.x may or may not be specified.if not specified,any number in any set that satisfies the next argument #argument N and P# is returned. (b)P is optional but N is not. (c)correct,N is the number of sets the number x MUST skip before re-occuring. (2)N is not optional.N must be specified,N determines which number is returned when x is not specified as well as the set to be returned #set where x re-occurs after N sets # (3)you are correct except that N MUST be specified because anytime the value of N changes, x also changes. (4)the set where x re-occurs must always be returned regardless of whether p is specified or not. (5)N must be specified # i think this answers the above question. note 1)from the data above,there are only 5 possible positions in every set(from 0-4).(2)the number of sets runs to thousands hence the data very large but X ranges from 1 to 90.the numbers repeat randomly |
PhenomenonVFX: Aha. I think I get it now. Clearer.ok..thanks |
Hello no!...are u a fastspoke? |
to make it clearer,look at the number 12 in the data below. set1=('12','18','44','56') set2=('13','40','16','04') set3=('63','85','78','60') set4=('17','35','12','20') set5=('32','41','73','87') set6=('12','23','02','61') the number 12 occurs at set1 (position 0),set4(position 2), and set6(position 0). if the user inputs: search(x) which re-occurs after (2) sets. the program returns the number 12,set1, and set4. in this example x=12, and N=2. N equals 2 because the number 12 skips set2 and set3 before re-occuring at set4. but if the user inputs: search(x) which re-occurs after (4)sets. the program returns the number 12,set1, and set6. it returns 12 because,it is d only number in the dat which after occuring,re-occurs again after skipping 4 sets #hence satisfying N=4# Hence anytime the value of N changes, the number returned will be different .thanks for your time. |
PhenomenonVF: One question though, what type would d property be? Would it be an integer or a sentence? How would the property be specified? Would the property always be d same or would it change? I am not even sure I understand the problem any longer.sorry for not being concise ##my brain is about to knock## the type would always be an integer,since the data is composed of integers. def jump(x) in any set that re-occurs after skippin (N number of set) #where x=any int in the data which the user inputs. N = this refers to the number of sets skipped by x before occurring again.the user must input N also. if there is a number(x) in the data which occurs and re-occurs again after skipping N sets,the program returns the number,the set it first occurs and d set where it re-occurs. |
PhenomenonVFX: Ok. If I understand, u want to be able to input a number and search for how many times it occurs in a collection of sets, which sets it occurs in and its position (index) in the respective set...yeah,thats close. let me make it simply.lets call the function "jump".in the data above,the number 20 and 30 occurs in set1 and and also at set4.simply put,the numbers are said to have jumped from set1 to set4.they jumped 2 sets # set2 and set3 # and re-occurs at set4. the problem now is,the user is searching a number #number can be specified by user or not# which occur anywhere in the which "jumps" by a specified count #this must be specified by user# to another set. all the program does after searching is to return d number that meets the search conditions,the set where occur,and the set where they have jumped to # if the number is not specified,all numbers that meet this search condition are returned# ##let me leave the position a number occupies out of it## |
assuming a user is searching for any number in the data which occurs in any set at position 0 #position is optional# which re-occurs at position 0 after counting 4 sets #counting is a property#...the program searches and returns 20(the number),set1(the set where it occurs), set4 (the set where it re-occurs after counting 4 sets)...if position is not specified,the program returns 20 and 30,set1,set4 (the 2 numbers that has the property specified # i.e the numbers that re-occurs after counting 4 sets# ) but let say the user searches for any number that occurs in any set at position 3 #position specified# which re-occurs at 1 #position specified again# after counting for sets...the program returns "not found or not available". this is because although 20 and 30 occurs in set1,they are not in position 3 and even if any of them were to occur at position 3,both numbers are not in position 1 after counting 4 sets as specified by the user. |
here is the data: set1= ('20','30','21','14') set2= ('66','04','90','13') set3= ('38','63','45','11') set4= ('20','30','44','60') set5= ('31','11','90','60') set6= ('27','38','30','36') ## the data can contain thousands of sets with each set having just 4 different numbers in the range(90)### how do i create a program using python that searches for a specified number or any number in the data above based on "properties" of the number in the data. properties refers to how a particular number occurs from one set to another.the program searches data for any number with d property inputed by d user and returns the number and the sets where the number has the properties or else it returns "property not available" for example 20 and 30 occurs in set1 at position 0 and 1 respectively and re_occurs at set4 position 0 and 1 respectively. |
PhenomenonVFX: I dont get the problem. Could u make it clearer?ok..i will make it clearer in my next post.i am happy that you are here to help me.thanks a million times. @ajibel...i only have saturday and sunday to practice programming.so am trying to maximize my learning |
. |
bright007: here is an example:thanks for your prompt reply. based on the data above,pls help me to define the occur_function such that the user just searches for a specific or any number in the data based on properties imagined by the user.for example the user may search the data for any number that is in a particular or any position in any set which subsequently re-occurs at a particular/ any position after counting an inputed number of sets. |
thanks once again pheno...i will try the correction for the "turn" function. |
Ajibaby,wats up? never knew you were a pythonian(after sighting you many times in jokes section)..pls check my thread on "help with python problem"....help me with d solution. |
also,how do i use python to search an already existing data.the data contains a range of numbers that occurs as a set of 4 different numbers(within the range).the sets are arranged and numbered sequentially.here is an example: set(1)['22','35','18','03'] set(2)['38','65','13','45'] set(3)['02','65','52','49'] set(4)['53','31','58','18'] set(5)['18','35','66','20'] from the above data,in set 1 35 in position 1 #since items in python starts counting from zero# "jumps to" or repeats again at set 5 or simply put it repeats again after counting 5 sets #that is from set 1 to 5#. how do i tell python to print the number (in this example 35) and the sets where this property occurs. ##my head is seriously aching after pondering over this problem since morning without success. |
@phenomenoVFX:Pls if you are not so busy,i would like you to give me a line by line explanation of how you defined the "turn" function.i cant seem to understand everything.i am marvelled that its working. |
PhenomenonVFX: Lest I forget, are u doing this as a hobby or is it some sort of academic chore?....though not a computer science student,i love programming have always wanted to be able write my own imaginatinations. thanks phenomenonVFX.I have tried the code with success. the "y=raw_input" was returning error so i deleted it. the "return int((str(x),reverse()))" is returning error and not working.hence,if i type turn(35) into IDLE,it returns an error thus: name "reverse" not defined. but if i type turn(10) and turn(19),it returns my expected answer(1 and 19),hence its working. |
ok...i use python 3.3.2 but also have version 2.7.3.I enter the codes and save it as a python script before running with IDLE. I will try once again.thanks phenomenonVFX.I have download the book. |
ok...i use python 3.3.2 but also have version 2.7.3.I enter the codes and save it as a python script before running with IDLE. I will try once again.thanks thanks phenomenonVFX.I have download the book. |
emphatic yes! do you know that the poster that asked this question chindi: Yes.is mad and now in yaba-left? |
@phenomenonVFX:i tried the code but its returning a name error,thus; "name" is not defined.pls help me check for any correction.Thanks for the recommendation,i will get it. |
thanks boss for your quickie reply.i will try it now. |
PhenomenonVFX: The problem isnt clear. |
PhenomenonVFX: The problem isnt clear.....it will be in raw_input.for example after running the module,the user will type the function(thrust or turn) followed by any number within range (91) for the program to execute.thanks for the reply |
1 2 3 4 5 6 7 8 ... 63 64 65 66 67 68 69 70 71 (of 184 pages)
Cheers.
1)from the data above,there are only 5 possible positions in every set(from 0-4).
