Nairaland General › Re: Special Codes To Format Text On Nairaland by phililp(m): 7:42am On May 29, 2017 |
op size no gree work o...
be fucking bold
be fucking italics
be fucking size twelve
be underlined
be red color |
Nairaland General › Re: Special Codes To Format Text On Nairaland by phililp(m): 7:36am On May 29, 2017 |
[size=58]testing[/size] |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 8:51pm On May 28, 2017 |
Folzye: someone please help out or give me a solution to escaping my way around the qualified engine u no see my quote nii?? lets see ur code... b4 enithing. |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 8:43pm On May 28, 2017 |
Folzye: sorry guys. I just started the homestudy assessment and there is an issue with the Qualified editor, pops out errors to what is actually not an error
for example after running the tests on my code and there was no issue perhaps, it got to where i wanted to test my function,here is what it displayed please lets see all your code.. not just the error msg.. |
Programming › Re: CBT In Python. V2 By Fleshbone by phililp(op): 8:21pm On May 28, 2017 |
TheLordIsGr8: I'm a sort of beginning pythonista myself. But I believe I've been digging a bit longer than you. So I'm learning as well. So in this jupyter notebook I try to explain the whole thing to myself. You can view it here
https://github.com/Parousiaic/nairaland_programming/blob/master/python_dunder_main.ipynb
Let me know if there's anything you don't get thanks Man! i now understand everything about the __name__ == __main your explanation nearly confused me though now working on the txt file... thanks again! |
Programming › Re: CBT In Python. V2 By Fleshbone by phililp(op): 3:42pm On May 28, 2017 |
kayoph: Yea i will be working on it this night.. And see what's up in the morrow.
Yh, i have written my version last night. Also, I will try and work on the GUI this night.. But i don't know how to post it like phililp did.. I don't what the indentation compromised. Phililp, how did you post yours? YAS!!! i remember now.... this was what happened. i first wrote the five first line of the post then summited(forgot to past the code).. then came back and modified and pasted the code... thats it |
Programming › Re: CBT In Python. V2 By Fleshbone by phililp(op): 3:00pm On May 28, 2017 |
kayoph: Yh, i have written my version last night. Also, I will try and work on the GUI this night.. But i don't know how to post it like phililp did.. I don't what the indentation compromised. Phililp, how did you post yours? dunno what i did O  ... just copied from my IDE and pasted.. then later modified. |
Programming › Re: CBT In Python. V2 By Fleshbone by phililp(op): 2:52pm On May 28, 2017 |
kayoph: Philip, i ran the codes it was pretty clean. Except for some typos. it's okay .
But really, as for me i don't think writing a code for an exam and the [/b]questions seen to be contained in the codes[b] is "fresh". i will rather create a text_file on my PC and the Program access the text_file for the question and answer, i feel its neater and more okay. i'll try and work on this too + i think am interested in the GUI.
fleshbone , thanks for stirring something up. thanks sir! but the thing is i really dunno how to do the text_file thing.. can u just give me a crash course one it?? pls... just a little light lemme build on |
Programming › Re: CBT In Python. V2 By Fleshbone by phililp(op): 2:47pm On May 28, 2017 |
TheLordIsGr8: from time import * import random
Better to write from time import whatever_you're_actually_going_to_use_from_the_time_module from random import whatever_you're_actually_going_to_use_from_the_random_module
Hope you don't mind if I ask what this line time.sleep(2) is doing in the student name class
Re-write the last two lines as
def main(): if __name__=="__main__": name() subject_selector
The above are more about best practices than about code correctness though.
Your questions is a dictionary. How are you indexing into it like a list?
I'm trying to understand what you intend to do in that for loop. I'll post my code for you to take a look thanks sir; 'll keep these corrections in mind... but what exactly does the if _name_ == _main_ do  ? |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 8:25am On May 28, 2017 |
Folzye: Is a boot-camper allowed to choose specific project they will like to work on or it's andela that specifies what they should do. wasnt ma fault sir... ar wud av reserved ma comment if u had asked the question exactly like this. now u see.. you are too crawly. |
Programming › Re: CBT In Python. V2 By Fleshbone by phililp(op): 7:19am On May 28, 2017 |
fleshbone: Am currently reading a book about GUI Using Tkinter module.
I would come up with something soon. pls boss.... what the name of the book... is it E-book. been using videos from thenewbostom.. need a book too |
Programming › Re: CBT In Python. V2 By Fleshbone by phililp(op): 7:16am On May 28, 2017 |
kayoph: Philip, i ran the codes it was pretty clean. Except for some typos. it's okay .
But really, as for me i don't think writing a code for an exam and the [/b]questions seen to be contained in the codes[b] is "fresh". i will rather create a text_file on my PC and the Program access the text_file for the question and answer, i feel its neater and more okay. i'll try and work on this too + i think am interested in the GUI.
fleshbone , thanks for stirring something up. thanks for the hint.... about the GUI... u working on it too?? |
Programming › Re: CBT In Python. V2 By Fleshbone by phililp(op): 7:14am On May 28, 2017 |
airsaylongcon: Why are you guys reinventing the wheel? Loads of Open Source CBT software exist to do what you are trying to do. I'd like to know what new addition you are making to already existing solutions? sorry but i think its important we start from somwhere... u dont expect a beginner to create new kinda AI. we learning bro |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 7:10am On May 28, 2017 |
Folzye: Is it Andela that gives the project to individual boot-campers? NO its Udacity...  |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 10:52pm On May 27, 2017 |
voltz: Front-end is HTML/CSS only following material design guide, back-end is Nodejs/express js with Firebase db and authentication. hmmm... i still have a long way to go |
Car Talk › Re: 5 Annoying Things People Do With Their Phone In Danfo Buses by phililp(m): 10:50pm On May 27, 2017 |
ymee: As long as they're deriving joy in it.
Promise and failed everywhere Please I'm seriously in need of a job(part-time or fulltime) , being jobless for a while. thanks Bsc mat/comp.sci location: Lagos Contact me for...your any of these SERVICES 1. Desktop-publishing 2. Web designing/training 3. Online registration 4. Corporate training 5. Software Training 6. Graphics designing 7. systems repair, installation and troubleshooting etc babs4realscience@yahoo.com ur computer science graduate.. u should have programming at your finger tips.... apply andela... enjoy |
Programming › CBT In Python. V2 By Fleshbone by phililp(op): 12:04pm On May 27, 2017 |
hi guys... about a week ago. fleshbone shared with us his first CBT code.. in python 2.7 so i re-wrote the code in python 3... here it is... wasnt good as the first though.. pls its open to criticism.. thanks from time import * import random
def name(): student_name = str(input('please enter your name:')) print('Welcome ', student_name, ' wait a while lets get you logged in.') sleep(2) return student_name def chemistry(): questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'], 2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',], 4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']} score = 0 answer_char = ['a', 'b', 'c', 'd',] for i in questions: quest = questions[i] print('\n', i,'.', quest[0]) answer = str(input('enter anser here:\n')) answer = answer.lower() while answer not in answer_char: print('only enter one of the options above') answer = str(input('enter anser here:\n')) answer = answer.lower() else: answer = answer.lower() if answer == quest[1]: score += 2 else: pass print ('your score is:', score) return all def mathematics(): questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'], 2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',], 4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']} score = 0 answer_char = ['a', 'b', 'c', 'd',] for i in questions: quest = questions[i] print('\n', i,'.', quest[0]) answer = str(input('enter anser here:\n')) answer = answer.lower() while answer not in answer_char: print('only enter one of the options above') answer = str(input('enter anser here:\n')) answer = answer.lower() else: answer = answer.lower() if answer == quest[1]: score += 2 else: pass print ('you scored', score) return all
def geography(): questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'], 2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',], 4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']} score = 0 answer_char = ['a', 'b', 'c', 'd',] for i in questions: quest = questions[i] print('\n', i,'.', quest[0]) answer = str(input('enter anser here:\n')) answer = answer.lower() while answer not in answer_char: print('only enter one of the options above') answer = str(input('enter anser here:\n')) answer = answer.lower() else: answer = answer.lower() if answer == quest[1]: score += 2 else: pass print ('you score ', score) return all
def economics(): questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'], 2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',], 4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']} score = 0 answer_char = ['a', 'b', 'c', 'd',] for i in questions: quest = questions[i] print('\n', i,'.', quest[0]) answer = str(input('enter anser here:\n')) answer = answer.lower() while answer not in answer_char: print('only enter one of the options above') answer = str(input('enter anser here:\n')) answer = answer.lower() else: answer = answer.lower() if answer == quest[1]: score += 2 else: pass print ('you scored ', score) return all
def agricultural_science(): questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'], 2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',], 4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']} score = 0 answer_char = ['a', 'b', 'c', 'd',] for i in questions: quest = questions[i] print('\n', i,'.', quest[0]) answer = str(input('enter anser here:\n')) answer = answer.lower() while answer not in answer_char: print('only enter one of the options above') answer = str(input('enter anser here:\n')) answer = answer.lower() else: answer = answer.lower() if answer == quest[1]: score += 2 else: pass print ('you scored', score) return all
def physics(): questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'], 2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',], 4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']} score = 0 answer_char = ['a', 'b', 'c', 'd',] for i in questions: quest = questions[i] print('\n', i,'.', quest[0]) answer = str(input('enter anser here:\n')) answer = answer.lower() while answer not in answer_char: print('only enter one of the options above') answer = str(input('enter anser here:\n')) answer = answer.lower() else: answer = answer.lower() if answer == quest[1]: score += 2 else: pass print ('you scored ', score) return all
def english(): questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'], 2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',], 4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']} score = 0 answer_char = ['a', 'b', 'c', 'd',] for i in questions: quest = questions[i] print('\n', i,'.', quest[0]) answer = str(input('enter anser here:\n')) answer = answer.lower() while answer not in answer_char: print('only enter one of the options above') answer = str(input('enter anser here:\n')) answer = answer.lower() else: answer = answer.lower() if answer == quest[1]: score += 2 else: pass print ('you scored ', score) return all
def biology(): questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'], 2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',], 4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'], 5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']} score = 0 answer_char = ['a', 'b', 'c', 'd',] for i in questions: quest = random.choice(questions.values()) print('\n', i,'.', quest[0]) answer = str(input('enter anser here:\n')) answer = answer.lower() while answer not in answer_char: print('only enter one of the options above') answer = str(input('enter anser here:\n')) answer = answer.lower() else: answer = answer.lower() if answer == quest[1]: score += 2 else: pass print ('your score is ', score) return all def subject_selector(): print('please select the subject you want to start with\n') subject = str(input('enter A - for Arigultural Science\n' 'enter B - for Biology\n' 'enter M - for Mathematics\n' 'enter C - for Chemistry\n' 'enter P - for Physics\n' 'enter G - for Geography\n' 'enter Eng - for English\n' 'enter Eco - for Economics\n:')) subject = subject.lower() choice_char = ['a', 'b', 'm', 'c', 'p', 'g', 'eng', 'eco'] while subject not in choice_char: print('please select either', str(choice_char)) subject = str(input('enter A - for Arigultural Science\n' 'enter B - for Biology\n' 'enter M - for Mathematics\n' 'enter C - for Chemistry\n' 'enter P - for Physics\n' 'enter G - for Geography\n' 'enter Eng - for English\n' 'enter Eco - for Economics\n:')) else: if subject == 'a': agricultural_science() elif subject == 'b': biology() elif subject == 'm': mathematics() elif subject == 'c': chemistry() elif subject == 'p': physics() elif subject == 'g': geography() elif subject == 'eng': english() elif subject == 'eco': economics() return all
name() subject_selector() |
Programming › Re: Help Me Ooo. I Sleep When Coding. by phililp(m): 8:21pm On May 26, 2017 |
it happened to me when i first started.. but not always though..
try doing this:
if this happens to you at night then u need to like 4 hours of sleep during the day.
when studying at night; sit close to a window where cold air touches you..
keep a bottle of cold water close... take a sip every ten minutes or as it suit u... but just take cold water... believe me this works.
pdf do becomes boring; thats tru.. wen u begin to feel sleepy move online (watch funny youtube videos for 5min(real house of comedy kills it))
come back; seep you cold water and continue... dont depend of pdfs.... try videos. |
Programming › Re: Help Me! I Need An IDE by phililp(op): 10:15am On May 23, 2017 |
gilloway: It is free and open source get it at eclipse.org thanks guys.. am now using eclipse with pydev thanks all |
|
Programming › Re: Help Me! I Need An IDE by phililp(op): 10:25pm On May 22, 2017 |
gilloway: Pydev with Eclipse works for me is it absolutely free |
Programming › Help Me! I Need An IDE by phililp(op): 7:02pm On May 22, 2017 |
dear nairagrammers...
when i staryted learning python i downloaded an IDE(pycharm) which was very cool and helped me learnt very fast..
but unfortunately for me.. i was only evaluating.. which just expired... jetbrain said one needs a licence to activate it and they give free to students... i tried applying but they said they dont recognise me email..
pls help me am going down. is there any free IDE that i can use?? i mean FREE...
tired of using python shell... dosent work as desired..
help a broda
fleshbone.. come in. |
|
Programming › Re: Python CBT Program by phililp(m): 7:01pm On May 21, 2017 |
fleshbone: Hello Python friends
I created a CBT program with Python. I would be glad to learn how to do more with few codes.
I also think some of us can learn from it too.
from time import time,sleep
my_questions = dict() my_answer = dict()
#Answer 1 my_answer['1'] = 'b' #Answer 2 my_answer['2'] = 'c' #Answer 3 my_answer['3'] = 'b' #Answer 4 my_answer['4'] = 'c' #Answer 5 my_answer['5'] = 'a'
#Question 1 my_questions['q_1'] = 'A paragraph inprose is equivalent to a?' my_questions['q_1a'] = 'A. Verse in a poetry' my_questions['q_1b'] = 'B. Stanza in poetry' my_questions['q_1c'] = 'C. Metre in poetry' my_questions['q_1d'] = 'D. Trope in poetry'
#Question 2 my_questions['q_2'] = 'The continuation of meaning without pause, from one line to the next is?' my_questions['q_2a'] = 'A. Synecdoche' my_questions['q_2b'] = 'B. Melodrama' my_questions['q_2c'] = 'C. Enjambment' my_questions['q_2d'] = 'D. Alliteration'
#Question 3 my_questions['q_3'] = 'Satire employs the use of?' my_questions['q_3a'] = 'A. Onomatopia' my_questions['q_3b'] = 'B. Irony' my_questions['q_3c'] = 'C. Synecdoche' my_questions['q_3d'] = 'D. Melancholy'
#Question 4 my_questions['q_4'] = 'The speech made by a character to himself on stage is?' my_questions['q_4a'] = 'A. Epilogue' my_questions['q_4b'] = 'B. Aside' my_questions['q_4c'] = 'C. Soliloguy' my_questions['q_4d'] = 'D. Monologue'
#Question 5 my_questions['q_5'] = 'A literary work that teaches moral is said to be?' my_questions['q_5a'] = 'A. Didactic' my_questions['q_5b'] = 'B. Intructive' my_questions['q_5c'] = 'C. Corrective' my_questions['q_5d'] = 'D. Impressive'
def candidate_name(): print 'Please enter your name:' name = str(raw_input()) return name
def salutation(): print '' print '' print ('Hello ' + candidate_name().upper() + ', You Accessment Start in a While') print '' print 'Literature-in-English' print ''
def answer(x): answer_char = ['a','b','c','d','A','B','C','D'] print 'Enter a Character' answer = str(raw_input()) if len(answer) > 1: while len(answer) != 1: print 'You Did not enter a character' answer = str(raw_input()) if answer in answer_char:
if my_answer[str(x)] == answer.lower(): return 1 else: while answer not in answer_char: print 'the charcter is not part of the options.' print 'Enter the right character' answer = str(raw_input()) return 0
def quest(): score = 0 for x in range (1,6): print ('Question ' + str(x)) print '' print (my_questions['q_'+ str(x) ]) print '' print (my_questions['q_'+ str(x) +'a']) print (my_questions['q_'+ str(x) +'b']) print (my_questions['q_'+ str(x) +'c']) print (my_questions['q_'+ str(x) +'d']) print ''
score += int(answer(x)) if x == 5: if score == 5: print '' print 'Amazing!' elif score == 4: print '' print 'Excellent!' elif score == 3: print '' print 'Good!' elif score == 2: print '' print 'Fair!' elif score == 1: print '' print 'Poor!' else: print '' print 'Very Poor!' print '' print ( 'Your Score is ' + str(score)) print '' def main(): #candidate_name()
salutation()
start_time = time()
quest()
print ('You Spent ' + str((time() - start_time)/60) + ' Minuites')
main()
----------------------------------------------------------------------------------------------------------
This I wrote with Python 2.7
If I successfully build the desktop application version of it using TKInter module, I shall post it here as well God Willing.
phililp am sure you can easily re-write this into Python 3.
Anyone who can Should please re-write this into python 3 so we can all learn.
Cheers. aye! aye! capt. am working on it.. have you ran the code and it worked?? |
Programming › Re: How Can I Activate My Windows 10 For It To Be Able To Install Corel Draw by phililp(m): 6:59pm On May 21, 2017 |
Amechiwap: How can i activate my windows 10 for it to be able to install Corel Draw, I want to install Corel Draw but is not installing i have used more than 3 different softwares yet is not working this information is not enough for me to help solve the problem.. what do you mean by its not installing.. what error message did it gave you.... beside you can use corel draw even without activating ur OS.. now u need to check if the software you wana install will run on the architect of ur OS(64 or 32 bit) get a software that is compatible.. this will work next time you post a problem give enough details that will help one understand the problem so as to help you |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 6:40pm On May 21, 2017 |
voltz; ar wana inbox u pls....... shud i?? |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 8:34am On May 20, 2017 |
voltz: Once you're confident in your home study, pick up on JavaScript ES6 and study alot. Research on database like Firebase and MongoDB. Basically, let passion be your driving force. pls... now u done with the bootcamp.. what next are you now a fellow or there is still another stage. |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 11:20pm On May 18, 2017 |
shogat: Philip Newman, the bootcamp facilator? lol.. no |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 10:04pm On May 18, 2017 |
Bahddo: the one he mentioned of course that was me he mentioned |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 10:16am On May 18, 2017 |
[quote author=Bahddo post=56634864]yeah, you are Philip, but not the Philip shogat was talking about.  [/quote which philip do you think he was talking about |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 10:04am On May 18, 2017 |
Bahddo: lol. I don't think that's Phil. Its me bro.. |
Jobs/Vacancies › Re: Andela: IT Training And Job by phililp(m): 9:57am On May 18, 2017 |
|