Jacob05's Posts
Nairaland Forum › Jacob05's Profile › Jacob05's Posts
1 2 3 4 5 6 7 8 ... 32 33 34 35 36 37 (of 37 pages)
@yawa-ti-de don't mind him, he is a 'kid' seeking "knowledge". Let's not look at is words and answer the question firstly: they each paid $10 for a $30 worth room. correct secondly: the price of the room reduce to $25 and the cleck took $2 from there bills and gave them $1 each.correct the mistake arose from is calculations. Initially if the guys had met the manager with the clerk they would would have a bill of $25 to pay and 2 of the guys would have paid $8.33 while the other guy left would have $8.34 to pay.deducting this money from there excess bill which is $10. 2 guys paid in excess $1.67 and the third paid $1.66 in excess.The clerk then gave the three guys $3 and took $2 alway.but clerk forgot that initially two of the guys should have given him $8.33 and the third $8.34 but cleck overlook the $0.33 {8.33 ==> 8} the two guys must have paid and $0.34 {8.34 ==> 8} the third must have paid and round it off as 8 and add the $1 each to the $8 which is not correct and he sum total as $9*3 and add $2 he took which equals $29. And summing the error in the calculation we have 0.33 + 0.33 + 0.34 = 1 DO YOU GET IT NOW KIDDO ![]() |
:-x |
Nee. I don see this question before it is somehow childish and the writer did a mistake and mislead the readers with the calculations. And for your topic and question they both sounds childish. ![]() |
start by teaching me how to configure my mod_python 3.3.1(pls) |
COMING SOON THIS IS NOT PYTHON , THIS [COLOR=RED]IS C/C++ [/COLOR]IN PYTHON ![]() |
Edited def AverageWord (sentence): averagelength=round(float(sum([len(word) for word in sentence.split()]))/ len(sentence.split())) but bro Seun you started this shortcut codes |
But bro seun what about you post This is java in python [B]NOW[/B] THIS IS PERL IN PYTHON you are getting me confused Will still ![]() |
I will be glad if you can |
Have tried it and it doesn't work ![]() Cos if it doesn't work i wouldn't post it, |
@bro Seun But You Can Make the code even more complicated using your code (remember[b] Python is not java[/b]) ![]() def AverageWord (sentence): averagelength=round(float(sum([len(word) for word in sentence.split()]))/ len(sentence.split())) print "Average Length:", averagelength Don't worry if the code is not readable or don't understand the code, Trying to differentiate JAVA from PYTHON ![]() |
Yee! That is what i want to do before ooo BUT No regrets, am trying to be beginner friendly. @bro Seun Good Correction BUT i would have liked you code better if you had FLOAT it. |
Hmmmmm, i reserve my words ;-) |
** Word count. A common utility on Unix/Linux systems is a small program called “wc.” This program analyzes a file to determine the number of lines, words, and characters contained therein. Write your own version of wc. The program should accept a file name as input and then print three numbers showing the count of lines, words, and characters in the file. import os def WC(file_location): 'The location of the file should be given correctly with exetension(.txt)' if os.path.isfile(file_location)==False:print 'No file named as',file_location if os.path.isfile(file_location)==True: if os.path.splitext(file_location)[1].upper()[1:]=='TXT': txt_file=open(file_location,'r') text=txt_file.readlines() txt_file.close() line_counter=0 for line in text: if line=='': pass else: line_counter=line_counter + 1 print line_counter text_in_string='' for lines in text:text_in_string+=lines text_in_string2=text_in_string.split() word_counter=0 for word in text_in_string2: word_counter=word_counter+1 print word_counter num_characters=len(text_in_string) print 'You Have',line_counter,'lines in',os.path.split(file_location)[1] print 'You Have',word_counter,'words in',os.path.split(file_location)[1] print 'You Have',num_characters,'characters in',os.path.split(file_location)[1] else: print 'TXT Files Only' HOPE IT WORKS FOR YOU THINK AM DONE EXCEPT FOR THE TWO QUESTIONS WHICH I DON'T UNDERSTAND IT WAS PHRASED ![]() LET ME NOW HAVE A GOOD NIGHT REST |
** Write a program that calculates the average word length in a sentence entered by the user. Solution: def AvergeWord(sentence): words=sentence.split() len_words=len(words) if len_words==1:print 'You Just Entered a Word' else: total=0 for i in range(0,len_words): total +=len(words[i]) print total average=total/float(len_words) print 'The Averge Word length in The Sentence is',average |
** Write a program that counts the number of words in a sentence entered by the user. Solution: def NumWord(sentence): words=sentence.split() len_words=len(words) if len_words==1:print 'You Just Entered a Word' else:print 'You Have ',len_words,' Words in Your Sentence!!!' |
Seun:@ Bros Seun Thanks for the commendations in the other thread you don,t know how glad i am Even my Father and Mother had never commended me my on this programming thing they look at me as a kid although am 17 but clicking 18 next month. About the Func To me it is a like a range multiplier it receives a figure and multiple it by the corresponding (n-1) figure if the number got is not n or if it number is 0 it returns 1 But if n i continue the loop until the number got is Not n 0r = 0 example: func(1) = 1 the loop subtract 1 from 1 but the value got is 0 which is not n it returns 1 and breaks then multiple 1 by 1 which is equal to 1 func(2)=2 the loop subtract 1 from 2 it value got is 1 and multiples 1 by 2 the result 2 but since the value got (1) is still n the loop continues and subtract 1 from 1 but the value got is 0 the loop the return 1 and breaks then multiple 1 by 2 which equals 2 func(3)=6 the loop subtract 1 from 3 it got 2 and multiples 3 by 2 the result is 6 but the value got (2) is still n and the loop continues and subtract 1 from 2 the result is 1 and multiples the previous value which is 6 by 1 which equals 6 still the value got (1) is still n and continues by subtracting 1 from 1 but the result is 0 and return 1 then break the loop and the multiple the previous result (6) by 1 which equals 6 func(4) =24 4*func(4-1)= 4 *3 =12 continues result 3 12*func(3-1)=12*2 = 24 continues result 2 24*func(2-1)=24*1= 24 continues result 1 24*func(1-1) ""value equals 0 and breaks then return 1""" = 24 *1 = 24 final!!! func(5) = 120 1*1*2*3*4*5=120 func(6) =720 1*1*2*3*4*5*6=720 Hope i Got it Bro Seun ![]() |
zain Rule |
Start @ http://www.oopweb.com |
It looks like no one is posting where are you E_DIPO,donkoleone,alexis,pystar Etc |
It looks like no one is posting where are you E_DIPO,donkoleone,alexis |
@kobojunkie Good people never live long and bad adviser's live almost forever @ poster this guy gave You the best advise any one can give you just thank God you are not living in Lagos island and you know what he is talkin.men you are one you own, no body can give you any advise that is better than the one coming from the inner you,that is the best advise you can get. And to kobojunkie , big up's to you, you are the second best adviser this guy can have. |
OR do "Advanced" Google search cos with google you can get any software,videos,mp3,book or pdf's FREE hope you do your re"search" ![]() |
@Mr Seun thanks very much you don't know happy i am to recieve the admin's commendation although i have been a bad boy lately for posting free zain's mms ip's But with this comment i think i will face my programming and stop posting more ip's once again thanks for your comment ![]() |
It doesn't matter about the school, what matters is "DO YOU WANT TO LEARN" cos many have graduated from this so called computer institution and still have nothing to show for it.so it is up to you to decide if you really what to learn or go to "the best computer training institution" %-) ![]() |
Yee MONEY SPEAKING |
China has robbed many nigerians with CHINA PHONES now the frederal government with CHINA SATELLITE ![]() |
I just want this script to be readable for beginners that is why i did so much of repeatation and i will be glad if you can provide the C or perl version of the script. ![]() |
Answer to 5th question print "[1] to encode\n[2] to decode" i= raw_input("Enter option> " ![]() if i =='1': word=raw_input("Enter word to encode> " ![]() while len(word) == 0: word=raw_input("Enter word to encode> " ![]() for each in word: maps=chr(ord(each) + 2) print maps, if i == '2': word=raw_input("Enter word to decode> " ![]() while len(word) == 0: word=raw_input("Enter word to decode> " ![]() for each in word: maps=chr(ord(each) - 2) print maps, elif i not in ('1','2'): print "Input unknown" |
[quote author=E_DIPO link=topic=176782.msg3141181#msg3141181 date=1227709247]@ donkoleone, i am all in for python! jacob, can you please help with the remaining part of the questions or just give explanations, i hope to resume tutorials by tuesday nextweek after my OCA exams. best regards.[/quote]i don't quiet get the acronym question is it only for ram alone or for want? cause acronym words are relatively many but for the 4$th question this is the code letters=('$abcdefghijklmnopqrstuvwxyz') name=raw_input("Enter Name> " .lower()name=name[0] if name in letters: num=letters.find(name) numeric_value=num+5+12+12+5 print "Your Numeric value is "+ str(numeric_value) else: print "Unknown name" |
Tell me how you have made also with your jaga no jaguns no jaguar ok java ![]() |
Einestein: Make very thing SIMPLE but not SIMPLER With JAVA programming is SIMPLER But With PYTHON programming is SIMPLE . Python is ALL YOU NEED PRO |



Will still 
