Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,192,338 members, 7,947,528 topics. Date: Thursday, 12 September 2024 at 10:16 PM

My Collections Of Python Projects - Programming (3) - Nairaland

Nairaland Forum / Science/Technology / Programming / My Collections Of Python Projects (3860 Views)

2020 Fundamentals Of Python Programming Thread #1 (WITH PROJECTS) / How Can I Get “30 Days Of Python” Tutorial / Benefits Of PYTHON Programming As Career For Everyone Interested In IT Success (2) (3) (4)

(1) (2) (3) (4) (Reply) (Go Down)

Re: My Collections Of Python Projects by KlausMichaelson: 6:39am On Aug 05, 2020
Good morning everyone. Please Sorry I'm not really living up to the purpose of this thread for the past few days.
But let me tell you guys what I've been up to;
I have been working on a Django project(Web development). Try check out Mosh Hamedani (Python for Beginners) Video on YouTube. It's about 6hrs and 14mins. Around 5th hour or so, he already was doing web development using python and Django. So please check it out, you will learn a lot. I have been on it patiently and carefully, and believe me it's really interesting.

Don't forget "Mosh Hamedani*. He is a great guy and has other great tutorials too.

1 Like

Re: My Collections Of Python Projects by Nobody: 9:20am On Aug 05, 2020
KlausMichaelson:



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

it's well. keep up the good work.

1 Like

Re: My Collections Of Python Projects by KlausMichaelson: 5:54pm On Aug 05, 2020
BlaqTesla:


it's well. keep up the good work.

Thank you Sir
Re: My Collections Of Python Projects by KlausMichaelson: 6:53am On Aug 10, 2020
So I thought about Writing a code that accepts input from a user(a student). It collects the details of the student such as Fullname, Course Code, Matric Number etc and finally prints all the details as well the grade the student had in the Course.

I'll post it right after this very post.
Re: My Collections Of Python Projects by KlausMichaelson: 6:53am On Aug 10, 2020
name = input('What is your Name? ')
matric_no = input('What is your Matriculation number? ')
course_code = input('What is your course code? ')
score = input('What is your score?')
for score in range(100):
if score <= 100:
score = 'Grade A'
elif score <= 70:
score = 'Grade B'
elif score <= 60:
score = 'Grade C'
elif score <= 50:
score = 'Grade D'
elif score <= 40:
score = 'Grade D'
else:
score = 'Grade F'

print(f'Hi {name} with {matric_no} at the end of the semester, had {score} in {course_code}')

Alternatively;

Name = input('What is your Full Name? ')
Matric_number = input('What is your Matric Number? ')
Course_Code = input('What is your Course Code? ')
Score = int(input('What is your Score? (Score must not exceed 100) '))

if Score > 100:
print('invalid score')
elif Score <= 100 and Score >= 70:
Score = 'A'
elif Score <= 69 and Score >= 60:
Score = 'B'
elif Score <= 59 and Score >= 50:
Score = 'C'
elif Score <= 49 and Score >= 40:
Score = 'E'
else:
Score = 'F'

print(f'{Name} with a Matric No of {Matric_number} At the end of the semester, had Grade {Score} in {Course_Code}')
Re: My Collections Of Python Projects by peppo4live: 10:19am On Aug 10, 2020
KlausMichaelson:
name = input('What is your Name? ')
matric_no = input('What is your Matriculation number? ')
course_code = input('What is your course code? ')
score = input('What is your score?')
for score in range(100):
if score <= 100:
score = 'Grade A'
elif score <= 70:
score = 'Grade B'
elif score <= 60:
score = 'Grade C'
elif score <= 50:
score = 'Grade D'
elif score <= 40:
score = 'Grade D'
else:
score = 'Grade F'

print(f'Hi {name} with {matric_no} at the end of the semester, had {score} in {course_code}')

Alternatively;

Name = input('What is your Full Name? ')
Matric_number = input('What is your Matric Number? ')
Course_Code = input('What is your Course Code? ')
Score = int(input('What is your Score? (Score must not exceed 100) '))

if Score > 100:
print('invalid score')
elif Score <= 100 and Score >= 70:
Score = 'A'
elif Score <= 69 and Score >= 60:
Score = 'B'
elif Score <= 59 and Score >= 50:
Score = 'C'
elif Score <= 49 and Score >= 40:
Score = 'E'
else:
Score = 'F'

print(f'{Name} with a Matric No of {Matric_number} At the end of the semester, had Grade {Score} in {Course_Code}')


Nice one bro.... I Started learning python too of recent.... Keep the fire burning
Re: My Collections Of Python Projects by KlausMichaelson: 7:22pm On Aug 10, 2020
peppo4live:


Nice one bro.... I Started learning python too of recent.... Keep the fire burning

Thanks a lot. Keep it burning too.
Re: My Collections Of Python Projects by fortifiedng: 10:14pm On Aug 13, 2020
Phone should be in landscape mode

 Ya'll should check up my Guess game Program

import random
def guessGame():
# first we ask the user for their name
print("What's Your Name"wink
name = input()
print("Oh "+ name +" Guess the number 1-20"wink

# We generate the random number
secretNumber = random.randint(1,20)
print(secretNumber)
# if the guess is incorrect, [We ask for the Guess Number 6 times

for guessNumber in range(1,7):
print("Guess the number "wink
guess = input()

# Using try/except to catch error. In this case, ValueError.
# So if the user enters a string instead of a number it throws a ValueError

try:
if int(guess) > secretNumber:
print("Your Guess is too high"wink
elif int(guess) < secretNumber:
print("Your Guess is too low"wink
else:
break
except ValueError:
print("Please Input a Number"wink

if int(guess) == secretNumber:
print("Your Guess is correct. You Guessed the Number " + str(guessNumber) + " times"wink
else:
print("Try again"wink

guessGame()

1 Like

Re: My Collections Of Python Projects by Akhigbeblog(m): 7:26pm On Aug 20, 2020
KlausMichaelson:


I wish I can help but distance is the barrier.
Where do you reside Let me know if I can't link you up with someone that can help me get the videos
Re: My Collections Of Python Projects by KlausMichaelson: 7:03pm On Aug 21, 2020
Akhigbeblog:

Where do you reside Let me know if I can't link you up with someone that can help me get the videos

Lagos
Re: My Collections Of Python Projects by spyglaxx: 7:25pm On Aug 21, 2020
KlausMichaelson:


Sir any task at all. It could be to write a code to perform a particular function, I'll be very willing to do it.

I need a percentage increase calculator.
Re: My Collections Of Python Projects by Akhigbeblog(m): 8:23pm On Aug 21, 2020
KlausMichaelson:


Lagos
Where in Lagos?
Re: My Collections Of Python Projects by KlausMichaelson: 8:38pm On Aug 21, 2020
Akhigbeblog:

Where in Lagos?
Close to Trade Fair. For reasons best known to me, I can't disclose more than that Sir.
Re: My Collections Of Python Projects by KlausMichaelson: 8:41pm On Aug 21, 2020
spyglaxx:


I need a percentage increase calculator.

Please Expantiate Sir. I really have the time to get it done!
Re: My Collections Of Python Projects by KlausMichaelson: 9:06pm On Aug 21, 2020
fortifiedng:
Phone should be in landscape mode

Ya'll should check up my Guess game Program

You did a great job Sir. Below is a similar code.
The limitations I had here is that I can't declare my secret number to be within the range of 1 to 21. Also I couldn't write the part of the code that will tell the user the number of times they tried.

I learnt a lot from your code but I'll love to know how to overcome my own limitations without declaring a function like you did in yours. Or better still, how can I include that code my already written code. Thank you.


#A code for a user to guess a number

Secret_number = 5
guess_count = 0
guess_limit = 6

try:
While guess_count < guess_limit:
guess_count += 1
guess = int(input(' Guess a Number: ')
if guess == secret_number:
print('Your Guess is Correct!')
break
else:
print('Sorry you Failed')
except ValueError:
print('Please input a number')
Re: My Collections Of Python Projects by Akhigbeblog(m): 9:20pm On Aug 21, 2020
KlausMichaelson:

Close to Trade Fair. For reasons best known to me, I can't disclose more than that Sir.
Lol toh, but I want know where you stay so I could send a friend in lag to hook up with you so you can send the videos to him
Re: My Collections Of Python Projects by KlausMichaelson: 10:07pm On Aug 21, 2020
Akhigbeblog:

Lol toh, but I want know where you stay so I could send a friend in lag to hook up with you so you can send the videos to him
Alright send me a PM
Re: My Collections Of Python Projects by Akhigbeblog(m): 10:29pm On Aug 21, 2020
KlausMichaelson:

Alright send me a PM
How
Re: My Collections Of Python Projects by KlausMichaelson: 10:52pm On Aug 21, 2020
Akhigbeblog:

How

It's simple. Go to my profile and click "Send an Email to KlausMichaelson"
From there we can chat Better Sir.
Re: My Collections Of Python Projects by Akhigbeblog(m): 10:56pm On Aug 21, 2020
KlausMichaelson:


It's simple. Go to my profile and click "Send an Email to KlausMichaelson"
From there we can chat Better Sir.
Done, I'll be waiting for your reply
Re: My Collections Of Python Projects by spyglaxx: 9:41am On Aug 22, 2020
KlausMichaelson:

Please Expantiate Sir. I really have the time to get it done!


Example: A pair of socks went from $5 to $6, what is the percentage change?
Answer (Method 1):

Step 1: $5 to $6 is a $1 increase
Step 2: Divide by the old value: $1/$5 = 0.2
Step 3: Convert 0.2 to percentage: 0.2×100 = 20% rise
Re: My Collections Of Python Projects by ibromodzi: 11:30am On Aug 22, 2020
KlausMichaelson:


It's simple. Go to my profile and click "Send an Email to KlausMichaelson"
From there we can chat Better Sir.

Boss I'm still waiting for the solution to my challenge oo
Re: My Collections Of Python Projects by KlausMichaelson: 7:27pm On Aug 23, 2020
ibromodzi:


Boss I'm still waiting for the solution to my challenge oo


Sir please give me a clue. I've been writing many codes but they are not working. I tried using Dictionary for the days (Sun-sat are the keys while 0-6 are the values). The code I wrote is great but I don't know how to call each of the Keys and values from the days (dictionary).


Sir please a clue will really help. Thanks smiley
Re: My Collections Of Python Projects by KlausMichaelson: 10:23pm On Aug 23, 2020
Akhigbeblog:

Done, I'll be waiting for your reply

Sorry this is coming late. I have replied your mail Sir
Re: My Collections Of Python Projects by KlausMichaelson: 11:05pm On Aug 23, 2020
spyglaxx:



Example: A pair of socks went from $5 to $6, what is the percentage change?
Answer (Method 1):

Step 1: $5 to $6 is a $1 increase
Step 2: Divide by the old value: $1/$5 = 0.2
Step 3: Convert 0.2 to percentage: 0.2×100 = 20% rise

Sir I am really sorry about the delay. This code actually took me about 5mins to write. I actually appreciate the assignment Sir. I want more!
Below is the code:


#Percentage increase Calculator
price1 = int(input('What is the old price? '))
price2 = int(input('What is the new price? '))

try:
def operation(price1, price2):
percentage_increase = ((price2 / price1) * 100) - 100

print(f'The percentage increase is by {percentage_increase}%')


operation(price1, price2)
except ZeroDivisionError:
print('input a price')
Re: My Collections Of Python Projects by spyglaxx: 11:58pm On Aug 23, 2020
KlausMichaelson:

Sir I am really sorry about the delay. This code actually took me about 5mins to write. I actually appreciate the assignment Sir. I want more!
Below is the code:


#Percentage increase Calculator
price1 = int(input('What is the old price? '))
price2 = int(input('What is the new price? '))

try:
def operation(price1, price2):
percentage_increase = ((price2 / price1) * 100) - 100

print(f'The percentage increase is by {percentage_increase}%')


operation(price1, price2)
except ZeroDivisionError:
print('input a price')


You are doing well.
Next is to write the output in tkinter gui. Upload here.
Re: My Collections Of Python Projects by ibromodzi: 12:38am On Aug 24, 2020
KlausMichaelson:



Sir please give me a clue. I've been writing many codes but they are not working. I tried using Dictionary for the days (Sun-sat are the keys while 0-6 are the values). The code I wrote is great but I don't know how to call each of the Keys and values from the days (dictionary).


Sir please a clue will really help. Thanks smiley

In numerical calculation, the days of the week are represented as weekday numbers. If Monday is the first day of the week, the days may be coded 1 to 7, for Monday through Sunday, as is practiced in ISO 8601. The day designated with 7 may also be counted as 0, by applying the arithmetic modulo 7, which calculates the remainder of a number after division by 7. Thus, the number 7 is treated as 0, 8 as 1, 9 as 2, 18 as 4 and so on. If Sunday is counted as day 1, then 7 days later (i.e. day cool is also a Sunday, and day 18 is the same as day 4, which is a Wednesday since this falls three days after Sunday. The basic approach of nearly all of the methods to calculate the day of the week begins by starting from an 'anchor date': a known pair (such as January 1, 1800 as a Wednesday), determining the number of days between the known day and the day that you are trying to determine, and using arithmetic modulo 7 to find a new numerical day of the week. ----- WIKIPEDIA
Re: My Collections Of Python Projects by KlausMichaelson: 2:14am On Aug 24, 2020
spyglaxx:


You are doing well.
Next is to write the output in tkinter gui. Upload here.

Thank you Sir, I appreciate. Unfortunately I am not into GUI Sir.
Re: My Collections Of Python Projects by KlausMichaelson: 2:59am On Aug 24, 2020
ibromodzi:


In numerical calculation, the days of the week are represented as weekday numbers. If Monday is the first day of the week, the days may be coded 1 to 7, for Monday through Sunday, as is practiced in ISO 8601. The day designated with 7 may also be counted as 0, by applying the arithmetic modulo 7, which calculates the remainder of a number after division by 7. Thus, the number 7 is treated as 0, 8 as 1, 9 as 2, 18 as 4 and so on. If Sunday is counted as day 1, then 7 days later (i.e. day cool is also a Sunday, and day 18 is the same as day 4, which is a Wednesday since this falls three days after Sunday. The basic approach of nearly all of the methods to calculate the day of the week begins by starting from an 'anchor date': a known pair (such as January 1, 1800 as a Wednesday), determining the number of days between the known day and the day that you are trying to determine, and using arithmetic modulo 7 to find a new numerical day of the week. ----- WIKIPEDIA


A very tricky one for me. Tricky but simple on. the long run. I really appreciate this Sir. It got me wondering if there are some Python basics I still haven't come across grin. Below is the code and I hope it's correct.


starting_day = int(input('Sunday through Saturday is 0 through 6, so what Day number are you leaving? '))

length_of_day = int(input('How many days will you be away? '))

Total_days = starting_day + length_of_day

Returning_day = Total_days % 7

print(f'You will return on Day {Returning_day} ')
Re: My Collections Of Python Projects by Jas80: 12:17pm On Aug 24, 2020
KlausMichaelson:



Sir please give me a clue. I've been writing many codes but they are not working. I tried using Dictionary for the days (Sun-sat are the keys while 0-6 are the values). The code I wrote is great but I don't know how to call each of the Keys and values from the days (dictionary).


Sir please a clue will really help. Thanks smiley



Don't know if this is late but next time use the foreach loop for this, as in foreach(days as key=> values)

then use the key or values, whenever you want to call any key or value
Re: My Collections Of Python Projects by KlausMichaelson: 12:24pm On Aug 24, 2020
Jas80:




Don't know if this is late but next time use the foreach loop for this, as in foreach(days as key=> values)

then use the key or values, whenever you want to call any key or value


Wow I'm just getting to know about the Foreach loop. Sir I will go back to learn it. Thanks, I really appreciate your response.


Sir kindly look at the Code I wrote for that task. Tell me what you think about it cos it actually ran perfectly. Thank you
Re: My Collections Of Python Projects by edunwanna: 12:43pm On Aug 24, 2020
Find freelance WebDesign and programming jobs, including many other IT based jobs at >> https:// dailyjobsnigeria.com /job/senior-software-engineer/

(1) (2) (3) (4) (Reply)

Google Interview Question: How Would You Explain Database To A 5-year Old Child? / ( At Present)"watch Lucy 2014 Online" #streaming / How Well-paid Are Software Developers In Nigeria?

Viewing this topic: 1 guest(s)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 3
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.