₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,019 members, 8,448,248 topics. Date: Monday, 20 July 2026 at 05:05 AM

Toggle theme

KlausMichaelson's Posts

Nairaland ForumKlausMichaelson's ProfileKlausMichaelson's Posts

1 2 3 4 5 6 7 8 9 (of 9 pages)

ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 6:33am On Aug 05, 2020
BlaqTesla:
The guy is still a toddler naaa... he will get to function very soon.
Lols cheesy
Gbas Gbos Gbas Gbos. you've finished me sir.

I updated that code through the help of My Ogas here. The updated code is much better. Yes I'm still a toddler
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 3:59pm On Aug 04, 2020
ibromodzi:
Challenge for you

It is possible to name the days 0 thru 6 where day 0 is Sunday and day 6 is Saturday. If you go on a wonderful holiday leaving on day number 3 (a Wednesday) and you return home after 10 nights you would return home on a Saturday (day 6). Write a general version of the program which asks for the starting day number, and the length of your stay, and it will tell you the number of day of the week you will return on.

Note: do not use any calendar module
Good day Sir. I really love this one smiley
Sorry I've been up to somethings for a while now.

My system is down at the moment. But for the main time I'll try to figure it out in my head. Thank you sir.
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 9:12pm On Aug 03, 2020
UnchainedAddict:
on WhatsApp or here ? just the two of us , I'm tired of pointless groups
Honestly I would have loved it but for the sake of Some persons who would be grateful to see everything here from cradle in later times,, I would want it to be done here.

Thank you for the Idea.

So sir how do we Kick off??
Honestly I thought I was an intermediate, but I need to be honest with myself, I'm still a learner huh
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 8:22pm On Aug 03, 2020
UnchainedAddict:
if you are interested ,we could learn together
Yes sir I want to learn.
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 8:22pm On Aug 03, 2020
Brukx:
I think you can tackle that exercise with basic python functions
Please How possible is that??
ProgrammingRe: Learn How To Create Websites With Python(Django Web Framework) by KlausMichaelson: 8:51am On Aug 02, 2020
And that was how the story ended?? huh sad
RomanceRe: Guys, Be Careful Of The Kind Of Lady You Are Planning To Marry by KlausMichaelson: 12:03pm On Aug 01, 2020
fati2001:
the reason why you should avoid cheap particles.
Hmmm
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 11:45am On Aug 01, 2020
ibromodzi:
ML for this task? Nope
Data structure and algorithm ain't the same as data science.
One last thing I'll say is that you should have your goal(s) defined. You can't learn everything at a time.
No be lie sad I can't learn everything at a time. I have to stick to my targets and have a defined goal. Thanks for the advice sir. I really appreciate it.
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 10:10am On Aug 01, 2020
ibromodzi:
A good knowledge of data structure and algorithm should set you on the right track.
Exactly, I had the feeling it's beyond the use of Python only. Machine learning is coming to mind.

Honestly this stuffs aren't too smooth like I thought. I went through machine learning tutorial yesterday, I was introduced to Sci-kit learn and some decision trees and algorithms. I'm just stuck at so many things right now(numpy, powerbi , Django) . But there is no problem.

I have no choice than to keep learning. Thank you sir.
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 8:43pm On Jul 31, 2020
Good evening my Pros please I have a Target at the moment. I don't know if anyone has ever considered the exercise before. It goes this way;

I want to write a code that will predict a time table or roster for lesson teachers in a senior secondary school.
Each teacher must have two subjects to teach. They must also appear at least 2times/perioy in a week and the period they are to teach must not clash with their second subject in any of the lesson period. The Program should enable me prepare a time table for all the teachers' lesson period.


My head is aching me cos I've been thinking about it for quite a while now.
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 8:35pm On Jul 31, 2020
ibromodzi:
He's actually taken that into cognizance, albeit not in a Pythonic way..

You guys should try to work on real life problems. You can use the site someone suggested above.
Alright that's cool.

Sir pls don't mind me. I'll still check out that website. It's just that I have diverted my attention to Django at the moment... This whole thing is really not easy.
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 7:23pm On Jul 31, 2020
aerozac:
You can check though this code
num_one = float(input("Plese input your first number.... "wink)
calculation = input("Please input the operand you want.... "wink.lower() # add, subtract, multiply, divide, power, percent, modulo
num_two = float(input("Plese input your second number.... "wink)

def operation(num_one, num_two):

if calculation == "divide" and num_two == 0:
print("Error"wink
elif calculation == "power" and num_one == 0:
print("Error"wink
elif calculation == "add":
sum = num_one + num_two
print(sum)
elif calculation == "subtract":
sub = num_one - num_two
print(sub)
elif calculation == "multiply":
multi = num_one * num_two
print(multi)
elif calculation == "divide":
division = num_one / num_two
print(division)
elif calculation == "power":
raised = num_one**num_two
print(raised)
elif calculation == "percent":
percentage = 0.01*num_one*num_two
print(percentage)
elif calculation == "modulo":
modulus = num_one % num_two
print(modulus)
else:
pass


operation(num_one, num_two)
Wow. I appreciate your time and response Sir. Thank you very much.

Sir why didn't you try using
>>>try:

>>>except ZeroDivisionError:
to avoid ZeroDivisionError when zero is used as the denominator? or did your code checkmate it?? Pls go through my own updated code.
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 7:17am On Jul 31, 2020
ibromodzi:
Well done! Keep it up....we are all learning
Thank you Sir
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 3:37am On Jul 31, 2020
Taofeekdboy:
I am through for the day as it is very late here, I would have shown you the code but you have to change the logic if you want to use the try and exept block.
I recommend while loop, if it's true, then it will keep requesting for the user's input if there's an error until you put a condition to meet.
Read more on while loop, try and exeption. As a beginner, try to fix things on your own, when you reach that point you feel you are lost then you can Google or use stackoverflow. Goodnight.
Sir I have updated my Code. Thank you very much.
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 3:36am On Jul 31, 2020
Akhigbeblog:
Aiit I'll, thanks so much
You're welcome sir
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 3:35am On Jul 31, 2020
ibromodzi:
Alright..... You are welcome sir.

You may add an extra bonus by implementing your solution in OOP (not necessary though).
Cheers!
Sir I have updated my Code. Thanks a lot.
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 3:20am On Jul 31, 2020
ibromodzi:

def operation():

'''
You start the top of the program with while loop
purpose: the program executes once and then checks if all condition are satisfied
if no error is encounterd, the program perform its function and end
else the while loop runs again and agin untill no error is encountered

Let me know if there's anything you don't get
'''
while True:
x = int(input('Enter a number '))
y = int(input('Enter another number '))
calculation = input(f"'You can eiher enter addition, subtraction, multiplication"
f" or division to perform an operation'"wink.lower()

if calculation == 'addition':
print(f"result is {x+y}"wink

elif calculation == 'subtraction':
print(f"result is {x-y}"wink

elif calculation == 'multiplication':
print(f"result is {x*y}"wink

elif calculation == 'division':
'''
this is where exception handling goes
'''
try:
'''
the next block first checks if the result has no remainder (modulus) i.e an integer
if the number has no remainder, you get the result of the division printed
else you print the result along with the modulus
I prefer to include this here instead of having it as a seperate calculation
'''
if x % y == 0:
print(f"result is {x/y}"wink
else:
print(f"result is {x/y} remainder {x%y}"wink

'''
You break the while loop if the above condtions run with no error
else, the user is forced to re enter the value again i.e the loop starts all over
'''
break

except ZeroDivisionError:
print ("can not divide by zero, enter a denominator other than zero"wink
except ValueError:
print ("Invalid parameter"wink
operation() #just call the function



Replace the emojis with closing brackets
Sir I am very sorry to not have brought this to your notice. I really feel Happy having you around Sir. I have to force myself up this early morning to rewrite my code especially the area you brought in the try.... except ZeroDivisionError. I have tried using it in my code before now, but I just didn't know where to bring it in. Thanks a lot for the clarification.

Although I didn't use while loop, I was able to still use the if and elif. Sir your corrections are welcomed gladly.
Sir check my updated Post to see my new code
Christianity EtcRe: Why I May Choose To Become An Atheist by KlausMichaelson(op): 10:30pm On Jul 30, 2020
Playthepianos:
Guy, please go and start listening to Apostle Selman's messages. Start this night please. You will get answers to many of your questions.

You can start with "Why Revivals Fail". Download it from Google.
Funny enough I still have his Messages in my PC. I've listened to them at some point. My brother I won't lie to you, he was trying to make me become an Idiot.

There is one which he made it look like a lady marrying a pastor is the best thing ever!

Most of these men you call men of God are actually Motivational speakers nothing more. They just know how to motivate their followers to do their wishes and feel it's God's desire for them(the church members) to do such.
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 10:21pm On Jul 30, 2020
Akhigbeblog:
Do you have link which I can use to to download the videos from?
No sir I don't. But why not try YouTube videos??
Mosh Hamedani on YouTube did a 6hr+ video on python. You'll love it!
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 10:20pm On Jul 30, 2020
Taofeekdboy:
I am through for the day as it is very late here, I would have shown you the code but you have to change the logic if you want to use the try and exept block.
I recommend while loop, if it's true, then it will keep requesting for the user's input if there's an error until you put a condition to meet.
Read more on while loop, try and exeption. As a beginner, try to fix things on your own, when you reach that point you feel you are lost then you can Google or use stackoverflow. Goodnight.
Alright sir. I will. Thank you for your time. I really appreciate. Sweet dreams
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 8:39pm On Jul 30, 2020
ibromodzi:
Your program assumes you'll be the only user who knows the right keywords to enter in order to get the desired result.

What tells the user the kind of operations your program is capable of performing?

What happens if the user does not enter the operations to be performed correctly as used in the program? Like Addition instead of addition (issue of cases).

What happens if the user tries to divide a number by zero?

When writing codes, I always like to think like a typical user who'll love to experiment with any possible combinations.

I challenge you to solve the problems above and update your code....
Good evening Sir

Your question:
What tells the user the kind of operations your program is capable of performing?

My Answer:
Calculation = input('addition, subtraction, multiplication, division, or modulo? ')

Your Question:
What happens if the user does not enter the operations to be performed correctly as used in the program? Like Addition instead of addition (issue of cases).

My Answer:
I use .lower if I want any input to be in lower case i.e
Calculation = input('addition, subtraction, multiplication, division, or modulo? ').lower

Your Question:
What happens if the user tries to divide a number by zero?

My Answer:
You use try except ZeroDivisionError or ValueError

But Sir I don't know where to to put in this try, except block in my program sad

The reason why I am yet to update my new code after about an hour now is because I don't know the position where the try..... except ZeroDivisionError and except ValueError block comes in. Please help me sir.

Thank you
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 7:25pm On Jul 30, 2020
Taofeekdboy:
based on what ibromodzi has said, I could see ZeroDivisionError, TypeError and other Errors in this code,
When writing mostly inputation code, you need to validate user's input because if you fail to do so, your program will break as Python is a runtime language. Try to put it in 'try' and 'exception' block.. I wish you Goodluck in your learning.
Thank you sir. I'm about to turn on my system. I'll send the updated code anytime soon.
RomanceRe: Value And Respect Your Woman No Matter The Size (photos) by KlausMichaelson: 6:32pm On Jul 30, 2020
fati2001:
Big, Bold, Black, Beautiful.
Are you married??
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 6:31pm On Jul 30, 2020
Akhigbeblog:
Abuja
I wish I can help but distance is the barrier.
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 11:09am On Jul 30, 2020
ibromodzi:
Alright..... You are welcome sir.

You may add an extra bonus by implementing your solution in OOP (not necessary though).
Cheers!
Sir bit by bit. I won't promise adding the extra bonus. But I'll try..
Anyways I really appreciate your responses. Thank you
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 10:21am On Jul 30, 2020
ibromodzi:
Your program assumes you'll be the only user who knows the right keywords to enter in order to get the desired result.

What tells the user the kind of operations your program is capable of performing?

What happens if the user does not enter the operations to be performed correctly as used in the program? Like Addition instead of addition (issue of cases).

What happens if the user tries to divide a number by zero?

When writing codes, I always like to think like a typical user who'll love to experiment with any possible combinations.

I challenge you to solve the problems above and update your code....
Ha Sir grin

There is no problem Sir. I am grateful for you Assessment. Thank you.

*What tells the user the kind of operations my program can run?

* What happens if the user does not enter the operations to be performed correctly as used in the program? Like Addition instead of addition (issue of cases)?

*What happens if the user tries to divide a number by zero?

Sir, I will give the updated code for it later today. Thank you very much sir. I really appreciate.
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 8:44am On Jul 30, 2020
Akhigbeblog:
I need offline videos cry
Where do you reside??
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 8:43am On Jul 30, 2020
Darivie04:
number1 = int(input('what number? '))
number2 = int(input('what number? '))
calculation = input('what operation do you want? ')

def operation(num1,num2):
if calculation == 'addition':
return num1 + num2
elif calculation == 'subtraction':
return num1 - num2
elif calculation == 'multiplication':
return num1 * num2
elif calculation == "division":
return num1 / num2
elif calculation == 'modulo':
return num1 % num2

print (operation(number1, number2))

A bit neater.
Sir how long have you been learning the language??
And what category would you place yourself??
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 6:49am On Jul 30, 2020
Darivie04:
number1 = int(input('what number? ')) number2 = int(input('what number? ')) calculation = input('what operation do you want? ')
def operation(num1,num2): if calculation == 'addition': return num1 + num2 elif calculation == 'subtraction': return num1 - num2 elif calculation == 'multiplication': return num1 * num2 elif calculation == "division": return num1 / num2 elif calculation == 'modulo': return num1 % num2
print (operation(number1, number2))
A bit neater.
Honestly this is Superb grin thank you so much.
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 6:47am On Jul 30, 2020
fortifiedng:
Why dont you visit [url]edabit.com[/url], you'd get enough coding challenges there.
I'll check it out sir. Thank you
RomanceRe: Lady Killed Her Boyfriend Then Had Sex With Her Dad And Married Him by KlausMichaelson: 12:34am On Jul 30, 2020
fati2001:
LA click LA chicken Maggi
Are you a lady? or a niggar? or you're married??
ProgrammingRe: My Collections Of Python Projects by KlausMichaelson(op): 12:03am On Jul 30, 2020
Donotread:
OK
Alright and thank you Sir

1 2 3 4 5 6 7 8 9 (of 9 pages)