₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,281 members, 8,449,566 topics. Date: Wednesday, 22 July 2026 at 01:59 AM

Toggle theme

Jacob05's Posts

Nairaland ForumJacob05's ProfileJacob05's Posts

1 2 3 4 5 6 7 8 ... 32 33 34 35 36 37 (of 37 pages)

ProgrammingRe: I Just Had To Modify This by jacob05(m): 11:16am On Dec 10, 2008
@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 wink

DO YOU GET IT NOW KIDDO     tongue
ProgrammingRe: I Just Had To Modify This by jacob05(m): 10:21am On Dec 10, 2008
:-x
ProgrammingRe: I Just Had To Modify This by jacob05(m): 9:02am On Dec 10, 2008
tongue 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. lipsrsealed
ProgrammingRe: Python Programming by jacob05(op): 10:21pm On Dec 07, 2008
start by teaching me how to configure my mod_python 3.3.1(pls)
ProgrammingRe: Python Programming by jacob05(op): 10:12pm On Dec 07, 2008
COMING SOON

THIS IS NOT PYTHON tongue, THIS [COLOR=RED]IS C/C++ [/COLOR]IN PYTHON grin
ProgrammingRe: Python Programming by jacob05(op): 12:33am On Dec 07, 2008
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
ProgrammingRe: Python Programming by jacob05(op): 12:04am On Dec 07, 2008
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 huh Will still  cool
ProgrammingRe: Python Programming by jacob05(op): 11:53pm On Dec 06, 2008
I will be glad if you can
ProgrammingRe: Python Programming by jacob05(op): 11:31pm On Dec 06, 2008
Have tried it and it doesn't workhuh

Cos if it doesn't work i wouldn't post it,
ProgrammingRe: Python Programming by jacob05(op): 9:23pm On Dec 06, 2008
@bro Seun
But You Can Make the code even more complicated using your code (remember[b] Python is not java[/b]) grin wink

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 wink grin
ProgrammingRe: Python Programming by jacob05(op): 3:26pm On Dec 06, 2008
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.
ProgrammingRe: Criticism Of Object Oriented Programming by jacob05(m): 2:45pm On Dec 06, 2008
Hmmmmm,


i reserve my words ;-)
ProgrammingRe: Python Programming by jacob05(op): 4:16am On Dec 05, 2008
** 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 undecided undecided
LET ME NOW HAVE A GOOD NIGHT REST
kiss
ProgrammingRe: Python Programming by jacob05(op): 1:46am On Dec 05, 2008
** 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
ProgrammingRe: Python Programming by jacob05(op): 12:47am On Dec 05, 2008
** 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!!!'
ProgrammingRe: Python Programming by jacob05(op): 9:55pm On Dec 04, 2008
Seun:
I think what we need to do is separate this thread into two sections:
    Python Programming and Python Language Tutorial

func = lambda n:n*func(n-1) if n else 1
Can anyone interpret the above function?

Another Tutorial: http://personalpages.tds.net/~kent37/stories/00020.html#e20can-be-learned-in-a-few-days
@ 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 undecided
PhonesRe: Research & "FBT" Thread ( This is not a chat room ) by jacob05(m): 9:48am On Dec 04, 2008
cool zain Rule
ProgrammingRe: Programming by jacob05(m): 5:40pm On Dec 03, 2008
ProgrammingRe: Python Programming by jacob05(op): 10:29am On Dec 03, 2008
It looks like no one is posting where are you E_DIPO,donkoleone,alexis,pystar Etc  embarassed undecided cry
ProgrammingRe: Python Programming by jacob05(op): 10:28am On Dec 03, 2008
It looks like no one is posting where are you E_DIPO,donkoleone,alexis embarassed undecided cry
ProgrammingRe: Help! Need Advice On What IT Field To Specialise In. by jacob05(m): 9:38am On Dec 03, 2008
@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.
Tech JobsRe: Chemcad Software,urgently Needed by jacob05(m): 9:11am On Dec 03, 2008
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" wink
ProgrammingRe: Programming Challenge(python,java,vb,.net: Etc) by jacob05(op): 8:50am On Dec 03, 2008
@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 cheesy
ProgrammingRe: Web Programming: Which Computer Schools Are The Best by jacob05(m): 8:31am On Dec 03, 2008
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" %-) cool wink
Jokes EtcRe: Banking by jacob05(m): 11:01am On Dec 01, 2008
Yee cheesy MONEY SPEAKING


kiss Nice one bro
PhonesRe: Nigerian China launched Nigcomsat-1 Missing In Space! by jacob05(m): 4:21pm On Nov 30, 2008
China has robbed many nigerians with CHINA PHONES now the frederal government with CHINA SATELLITE  cry undecided
ProgrammingRe: Programming Challenge(python,java,vb,.net: Etc) by jacob05(op): 3:41pm On Nov 30, 2008
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.   cool
ProgrammingRe: Python Programming by jacob05(op): 11:09am On Nov 27, 2008
Answer to 5th question

print "[1] to encode\n[2] to decode"

i= raw_input("Enter option> "wink
if i =='1':

word=raw_input("Enter word to encode> "wink

while len(word) == 0:

word=raw_input("Enter word to encode> "wink

for each in word:

maps=chr(ord(each) + 2)

print maps,

if i == '2':
word=raw_input("Enter word to decode> "wink

while len(word) == 0:

word=raw_input("Enter word to decode> "wink

for each in word:

maps=chr(ord(each) - 2)

print maps,
elif i not in ('1','2'):
print "Input unknown"
ProgrammingRe: Python Programming by jacob05(op): 12:57am On Nov 27, 2008
[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> "wink.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"
ProgrammingRe: Java Rules,who Thinks Otherwise? by jacob05(m): 3:41pm On Nov 25, 2008
Tell me how you have made also with your jaga no jaguns no jaguar ok java tongue
ProgrammingRe: Post Java Questions On Creating Files And Using Streams Here by jacob05(m): 12:34pm On Nov 25, 2008
Einestein: Make very thing SIMPLE but not SIMPLER



With JAVA programming is SIMPLER But With PYTHON cool programming is SIMPLE . Python is ALL YOU NEED PRO

1 2 3 4 5 6 7 8 ... 32 33 34 35 36 37 (of 37 pages)