Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,195,093 members, 7,957,092 topics. Date: Tuesday, 24 September 2024 at 07:02 AM

Jayphe's Posts

Nairaland Forum / Jayphe's Profile / Jayphe's Posts

(1) (2) (of 2 pages)

Gaming / Overmobile Online Games Forum!!! by jayphe(m): 3:55pm On May 08, 2021
Hmmm...lovers of mrush and titan wars! Let's us gather here and talk. I need a toon in Titan Wars with high stats. In return, I'll give out a toon in mrush.net. Who's in?
Crime / Re: Bashir Ahmad Speaks On US Army Rescue Operation In Nigeria by jayphe(m): 5:16pm On Nov 01, 2020
saaron:
Exactly! Some people will rather deceive themselves than face the fact that Nigeria is not a nation but a geographical location with many nations in it.

We're not one, just pretending to be one. I rather identify myself member of a tribe in 'Middle Belt' than waste my time seeing myself a Nigerian.
I feel more connected to my tribe, state and region than the satanic location called Nigeria.
Satanic location?
Sports / Re: Barca Troll Ronaldo & Juventus With This Photo After Messi Scored Them by jayphe(m): 7:55am On Oct 30, 2020
slawormiir:
Damnnn niggarrrr
Isoright
Lionel messi too good to be compared with pussy ass Ronaldo
Sometimes when i see people bring up arguments about Ronaldo and messi..i don't involve my self in such arguments because anyone involve in such arguments don't know what football is all about
If you are really a lover of soccer and you watch football anyday anytime twice on Thursday then you should be aware that messi is too good to be compared with Ronaldo
Simple...u should have said that Messi plays better than Ronaldo instead of trying to play 'innocent'. Why telling us you don't involve urself in such arguments when u are already 'preparing' one?
Programming / Re: Need For A Whatsapp Partner! by jayphe(m): 10:30pm On May 27, 2020
incogni2o:

Buzz me
Happy to help
Thanks bro!
Programming / Re: Need For A Whatsapp Partner! by jayphe(m): 10:30pm On May 27, 2020
incogni2o:

Buzz me
Happy to help
Thanks bro!
Programming / Need For A Whatsapp Partner! by jayphe(m): 9:58pm On May 27, 2020
Hello everyone. Abeg this lock down don tire me. Pls who wants to be my WhatsApp partner; gossip partner, reading � partner, Python partner, Music � partner and Science project partner? Biko, ẹjọ́, please drop ur num make I add you. Pls ooo. Help a brother in need of an active WhatsApp partner. I am expecting you people ooooo
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 7:57pm On May 10, 2020
Thanks for the opinion. I was talking in view of the user. I know the index starts from 0. You wouldn't expect the user to type 4 and the program return the 3rd value he entered.
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 11:41am On May 09, 2020
Phew!! I'm sorry for that long break. I know many people for don vex. I'm sorry. I'm back with an exercise but this one is kinda simple.
Exercise 7
Write a Python program that accepts data from the user be it integer, string, char, float or double. The program stores these in a container/array (list or tuple)


Finally, the program accepts an index from the user and uses the index to find the respective element if the array created. The program then prints the result.e.g.,
Let's say a user inputs the following:
Sam
12
Ben
Lagos
22
Tolu


The user then input 3 as the index, the program must return 'Ben' as the output.


Collinsanele Taofeekdboy kensmoney Daddyshome Zabiboy and lots more...lol!
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 8:28am On Apr 28, 2020

Exercise 6
Write a Python program that accepts an integer number and checks if it is an even number or an odd number. Pls don't use the % (modulus) operator. Let's see some genuius.
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 6:30am On Apr 27, 2020
kensmoney:
ken="kensmoney is good boy"
def count_char(a,b): char = b.lower() stri = a.lower() counter=0 for a in stri: if a == char: counter += 1
print(counter)


count_char(ken, "o" ) #4
I love ur approach.....

1 Like

Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 3:59pm On Apr 26, 2020
Zabiboy I've seen it. And it's a nice challenge. Bring in more!
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 3:57pm On Apr 26, 2020
Zabiboy:


Hv u seen the projects i wz talking of??

BTW, u said you wan talk to me...
Any Probs?
No problem at all. I go soon reach u sha. And about the project, I go check am now
Literature / Re: The Gambler Of Legend (T.G.L) by jayphe(m): 3:53pm On Apr 26, 2020
Behind you Treborblue ride on gallantly...
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 3:45pm On Apr 26, 2020

Exercise 5
Write a Python program that accepts a string and a character from the user. The program checks the number of times(frequency) the character appeared in the string. E.g. If the user enters "Michael Faraday" as the string and enters 'a' as the character, the program should display:

There are 4 a in Michael Faraday!


Collinsanele Taofeekdboy kensmoney Daddyshome Zabiboy
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 11:22am On Apr 25, 2020
OlamigokePhilip:


Welldone @jayphe. Great initiative.

Just a passing comment for anyone who might need this..

In my own opinion.. Whenever you find yourself in situations where you "need" to manipulate strings; Regular Expressions (RegEx) should always come to mind. It really makes it easier and DRY if needed intermittently for multiple strings with marginal differences that could still break your code.

My Answer to Question 1.

import re
link = "http://www.thapar.edu/index.php/about-us/mission"
result = re.sub(r'https?:\/\/(?:www\.)?', '', link)
result.split('/')[0] #returns desired result







That's a good suggestion bro! That's good!
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 9:14am On Apr 25, 2020
Taofeekdboy:

Thanks bro.
Obviously, it does!!!. Just worked on it with the aim of not using React, I worked with Django and JQuery because I wanted to master JQuery for small projects in which React might be an overkill. If time permits, I'm planning on moving it to a mobile app. Maybe it will be better there.
Wish you the best bro! Always the best!
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 9:13am On Apr 25, 2020

Collinsanele Taofeekdboy kensmoney Daddyshome Zabiboy

hmm....who else ooo? Let's get to business. Pls, let's try to read the question in details first. If the question asks for the users' input, then we should include an input statement. Zabiboy we need to talk ooo. This one wey I no see you....


Exercise 4
We are doing some 'loop and looping stuffs' today.


Write a Python program that accepts the name of a student, matric number, course code and the score he/she got in the course. E.g
Name: John Alfred
Matric. No.: MUC/CS/014/0882
Course Code: CMP 212
Score: 100

The program then print the result as:
John Alfred, MUC/CS/014/0882, CMP 212, Grade A


Using this grading table.
100-95 A
94-85 B
84-70 C
69-60 D
59-50 E
49-0 F

Corrections, advices, suggestions and opinions are highly welcome!

3 Likes

Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 8:51am On Apr 25, 2020
Runningwater:
I'm confused, the exercise said ACCEPT input from user. Isn't it like this?

def dateFun( currentDate, currentMonth, currentYear):
currentDate= int(input("Enter today's date: \n" )
currentMonth=int(input ("Enter today's month like 1 for January, 2 for February and so on: \n " )
currentYear=int(input("Enter current year: \n" )
message=currentDate,"/",currentMonth,"/",currentYear
return message

That's a wonderful approach Runningwater Kudos!
Buh u just defined the function. Anyway, I understand. That's gud!

1 Like

Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 8:49am On Apr 25, 2020
kensmoney:
import datetime

date_and_time = datetime.datetime.now()
today_date =(str(date_and_time))
today_date_slice = ( today_date[:10] )
formated_date = today_date_slice.replace( "-", "/"
)
year = ( formated_date[:4] )
month_and_date = ( formated_date[5:] )

mydate= month_and_date + "/" + year
print(mydate)

#04/24/2020

Nice one bro...buh the question mentioned 'ACCEPT from user' and I can't find input().
Also just has Collinsanele said, you don't need to slice at all. However, you did great. Well done kensmoney
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 8:41am On Apr 25, 2020
Taofeekdboy:

I saw this late, I have been busy with my project and it took a lot of my time.
I will leave it here for who is interested to check..
It is a social media clone I made.
http://mysocialapp.pythonanywhere.com

Looking forward to your comments
A nice start bro....still need some fixing sha! Kudos!
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 6:54pm On Apr 24, 2020
Zabiboy:
Op, these r short and not too tough projects...
Lets do the lengthy and real life application stuffs...
I can giv 3 diff. Projects if u guys are ok with d idea...

Note: these r projects i'v worked on/ working on
Bro, I never said these were projects! They are - just as you said - simple exercises to keep 'things' busy. There is no bad if you also contribute to this. And I really would love to see one of your projects!
Literature / Re: The Gambler Of Legend (T.G.L) by jayphe(m): 8:17am On Apr 24, 2020
Ride on bro! Ride on!

1 Like

Literature / Re: The Gambler Of Legend (T.G.L) by jayphe(m): 8:11am On Apr 24, 2020
Treborblue:
Oloyedprince1 crossfm jayphe temple1985
I dey ur side o... Welldone sir! wink cheesy
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 8:05am On Apr 24, 2020

Collinsanele, Taofeekdboy, kensmoney another one is here!

Exercise 3

Write a Python program that accepts day, month and year from the user and prints the result in this form:

Today is 23/04/2020
For example,
Input:
day = 21
mnth = 07
year = 2010

Output:
Today is 21/07/2010

Good luck guys!

1 Like

Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 7:58am On Apr 24, 2020
Collinsanele:

What is the mistake
Collinsanele, there was an IndexError stating 'list index out of range'
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 7:56am On Apr 24, 2020
kensmoney:
ken = "kensmoney is good"
def replaceWord(k): sentence = str(k) print(sentence.replace(" " , "_" )

replaceWord(ken)
#kensmoney_is_good
kensmoney, I love your 'idea of thinking'. You got it right sha. Good job bro!
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 7:53am On Apr 24, 2020
Taofeekdboy:

user_input = str(input('write your full name)) user_input.replace(' ', '_') print(user_input)
There was a space and a hypen in the 2nd argument of replace() Apart from that, you got it right! Bravo Toafeekdboy!
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 5:30pm On Apr 23, 2020

This is another exercise.
Exercise 2

Write a Python program that accepts a string/sentence from the user. The program then changes all spaces to underscores. Finally, it prints out the final result.

Good luck guys!

1 Like

Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 5:22pm On Apr 23, 2020

This is my solution.....

#Obtain the domain (thapar.edu) name from the URL
#http://www.thapar.edu/index.php/about-us/mission

url = "http://www.thapar.edu/index.php/about-us/mission"
print ("Getting 'thapar.edu' from ",url)

list_url = url.rsplit("/",3)
print(list_url)
a = list_url[0]
str1 = str(a)
print("\n",a)
result = str1.split(".",1)
print("Finally, we now have....\n",result[1])
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 5:21pm On Apr 23, 2020
Collinsanele:
site ="https://www......"
domain = site.split('//')[1].split("www.")[-1]
print(domain)
you're making a mistake....
Programming / Re: Python 3: Exercises And Solutions. by jayphe(m): 3:15pm On Apr 23, 2020
Collinsanele:
website = "www...." domain = website.split("http://www.")[1].split('/')[0] print(domain)
You are wrong...

(1) (2) (of 2 pages)

(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. 45
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.