Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,412 members, 7,808,467 topics. Date: Thursday, 25 April 2024 at 12:25 PM

A Thread For Tutorial On Python Programming - Programming (23) - Nairaland

Nairaland Forum / Science/Technology / Programming / A Thread For Tutorial On Python Programming (140233 Views)

Opportunity To Earn Little Pay Working On Python Assignment. / I want to solve question on python basic / I Have A Very Import Question On Python Syntax (2) (3) (4)

(1) (2) (3) ... (20) (21) (22) (23) (24) (25) (26) ... (32) (Reply) (Go Down)

Re: A Thread For Tutorial On Python Programming by FunctionX(m): 1:07pm On Aug 30, 2020
SirMichael1:


Python has an in text editor and a shell. I've been using that and it works just as much. Is there any difference?
I believe that the difference is quite visible based on the fact that some IDE supports plugins which can make your programming easier and faster.
Take for an instance the intellicode plugin: it can help in completing codes for you and even variable names and functions.

Try using vscode, and I doubt you'll ever go back to Python native IDLE

1 Like 1 Share

Re: A Thread For Tutorial On Python Programming by SirMichael1: 3:38pm On Aug 30, 2020
FunctionX:

I believe that the difference is quite visible based on the fact that some IDE supports plugins which can make your programming easier and faster.
Take for an instance the intellicode plugin: it can help in completing codes for you and even variable names and functions.

Try using vscode, and I doubt you'll ever go back to Python native IDLE
Thanks. I'll just download anaconda which has vs code and jupyter.
Re: A Thread For Tutorial On Python Programming by SirMichael1: 3:56pm On Aug 30, 2020
dannyCodes:

Actually, yes. IDLE is somewhat not that good for me(imho), it's good for when learning and writing short scripts but in a project, i cant imagine using IDLE. It doesnt support tabs(i dunno if it has a way to do this) and the ui is outdated. I'd prefer using VSCode, atom sublime etc except its a large project then pycharm.
If u r writing short scripts then i dnt see anything wrong with IDLE.
You're correct sir. It doesn't support multiple tabs but i find that it runs codes even without spaces between operators but vs code doesn't.
Re: A Thread For Tutorial On Python Programming by naijasensei: 8:42pm On Aug 30, 2020
dannyCodes:

Actually, yes. IDLE is somewhat not that good for me(imho), it's good for when learning and writing short scripts but in a project, i cant imagine using IDLE. It doesnt support tabs(i dunno if it has a way to do this) and the ui is outdated. I'd prefer using VSCode, atom sublime etc except its a large project then pycharm.
If u r writing short scripts then i dnt see anything wrong with IDLE.

I totally agree with you. The IDLE is some sort of a scratch pad, a workbook where you test out short scripts, it is also awkward to use. VS Code and sublime text are way better - personally, VS Code is my go to text editor because of its numerous plugins and configuration options.
Re: A Thread For Tutorial On Python Programming by dannyCodes: 9:58pm On Sep 01, 2020
SirMichael1:
You're correct sir. It doesn't support multiple tabs but i find that it runs codes even without spaces between operators but vs code doesn't.
Actually, vscode does.
Re: A Thread For Tutorial On Python Programming by crttraining: 10:26am On Sep 08, 2020
Thanks for sharing information, excellent info , keep continue this....
https://www.gobrainwiz.in/
Re: A Thread For Tutorial On Python Programming by galax1: 5:39pm On Sep 08, 2020
I promise I will follow every step
Re: A Thread For Tutorial On Python Programming by jidejado(m): 7:51pm On Sep 10, 2020
HELP!!!!
I am using pydroid 3 on my phone for Python practice. But anytime I define a function and I call the rest......it usually shows me a blank result even after putting in my variables...what may be the cause
Re: A Thread For Tutorial On Python Programming by Greenishland(f): 9:20pm On Sep 10, 2020
Re: A Thread For Tutorial On Python Programming by peacettw: 4:09pm On Sep 11, 2020
avalon7:
I have full "Python for research" course from Harvard including videos and assessment if you are interested like and quote... The number of likes would help me determine how interested people are

I won't give my like. Keep the course

3 Likes 1 Share

Re: A Thread For Tutorial On Python Programming by TypeSafe: 9:47pm On Sep 11, 2020
nappy760:


My bad
..the process is called decompiling

My bad grin


"https://itstillworks.com/convert-exe-code-7230643.html"

It is possible to decompile Python binaries (.pyc and .pyo) at Decompiler.com.
Re: A Thread For Tutorial On Python Programming by avalon7(m): 1:50pm On Sep 12, 2020
peacettw:


I won't give my like. Keep the course

Ahah when did i ask for your life biko ??
Re: A Thread For Tutorial On Python Programming by peacettw: 3:18pm On Sep 12, 2020
avalon7:


Ahah when did i ask for your life biko ??

You asked for likes as pre-requisite to a course. I thought that to be incredibly childish

1 Like

Re: A Thread For Tutorial On Python Programming by Seanixking: 11:32am On Sep 13, 2020
Paapii3d:
DAY 1 CONT'D
INSTALLATION AND SETUP FOR ANDROID, MAC, AND WINDOWS



https://www.youtube.com/watch?v=kfU3B7hy4Bs

Before we begin our journey into the exciting world of python, we need to get a couple of things set up. This would help us write our code effectively and enhance debugging. We will need to download some software and install them on our machines to get started.
Some of the softwares we need to install are: the python compiler, a text editor preferably Visual Studio Code, Git Bash for windows users and Pydroid 3 for Android Users.

The sections shows how u can correctly install them:

Mac Installation: 0:00
Android Installation: 8:24
Windows Installation: 10:31
please at the end of the video what did you type in that visual and git? is it ns or Ms didn't hear that well
Re: A Thread For Tutorial On Python Programming by Abra4real(m): 9:53pm On Sep 16, 2020
Missionaire:


It is quite sad that a Tech entrepreneur like Seun cannot promote a section dedicated to programming and tech like stackoverflow.
My question yet remains to be answered after several days. We do not have a tech community in Nigeria, we only have Tech events.

I ran the code on "ii" and it runs fine.
Re: A Thread For Tutorial On Python Programming by naijasensei: 9:56pm On Sep 16, 2020
jidejado:
HELP!!!!
I am using pydroid 3 on my phone for Python practice. But anytime I define a function and I call the rest......it usually shows me a blank result even after putting in my variables...what may be the cause

Provide screenshots of your problems, so that you can get assistance.
Re: A Thread For Tutorial On Python Programming by jidejado(m): 10:22am On Sep 17, 2020
naijasensei:


Provide screenshots of your problems, so that you can get assistance.

Please help me check..it's just showing program finished..no results

Re: A Thread For Tutorial On Python Programming by kenomobola(m): 5:17pm On Sep 17, 2020
jidejado:


Please help me check..it's just showing program finished..no results

Try this instead, study it and note the indentation:



def event_probability(event_outcomes, sample_space):
probability = (event_outcomes/sample_space) * 100
return round(probability, 1)

cards = 52
hearts = 13
heart_probability = event_probability(hearts, cards)

face_cards = 12
face_card_probability = event_probability(face_cards, cards)

queen_of_hearts = 1
queen_of_hearts_probability = event_probability(queen_of_hearts, cards)

print(f"Heart probability: {heart_probability}%" )
print(f"Face cards probability: {face_card_probability}%" )
print(f"Queen of hearts probability: {queen_of_hearts_probability}%" )

Re: A Thread For Tutorial On Python Programming by jidejado(m): 8:10am On Sep 18, 2020
Thanks....can u also help me with this..don't know what's wrong with the line of codes

Re: A Thread For Tutorial On Python Programming by kenomobola(m): 12:31pm On Sep 18, 2020
jidejado:
Thanks....can u also help me with this..don't know what's wrong with the line of codes

Hi, your major problem is indentation, you are not using your indentation properly. Indentation is used to group code blocks. From your code, it seems you want to see how many combinations of older and younger siblings you can have in 10000 tries with emphasis on the number of girls. I won't solve it for you because I want you to practice and understand. Here is the pseudocode, convert it to python.


define function random_kid()
#START FUNCTION

both_girls = 0
either_girl = 0
older_girl = 0

for i = 1 to 10000
#START FOR LOOP

younger = random.choice(['boy', 'girl'])
older = random.choice(['boy', 'girl'])

if older == 'girl'
older_girl += 1
if younger == 'girl'
both_girls += 1
#END IF
if younger == 'boy'
either_girl += 1
#END IF
else
if younger == 'girl'
either_girl += 1
#END IF ELSE

#END FOR LOOP

return [either_girl, older_girl, both_girls]
#END FUNCTION

#Call random_kid function
output = random_kid()
print("Either girl:", output[0])
print("OLder girl:", output[1])
print("Both girls:", output[2])


Note this is not actual code, read it, interprete it, then write yours. As for the second program you posted, personally I will advice you to stay away from advanced topics like pandas and dataframes until you are comfortable running simpler programs.
Re: A Thread For Tutorial On Python Programming by Semtu(m): 7:02pm On Sep 19, 2020
jidejado:
Thanks....can u also help me with this..don't know what's wrong with the line of codes

You are making your codes ambiguous and not printing properly. You can do it like this
dfme = pd.dataframe(d).mean()
Then print (dfme)
dfmed= pdf.dataframe(d).median()
Print(dfmed)

Whatever it is you want to print should be in a parenthesis unlike the return function
Re: A Thread For Tutorial On Python Programming by Najdorf: 10:08pm On Sep 19, 2020
jidejado:
Thanks....can u also help me with this..don't know what's wrong with the line of codes
First image:
1. You didn't import random.
2. Your function returns a value on the second line making the rest of the function redundant.
3.8th and 9th lines could lead to recursion issues.
Re: A Thread For Tutorial On Python Programming by Gokoyer1401: 6:47am On Sep 24, 2020
Hi guys, I have javascript coding to do. Anyone that wanna help me with it, should quote me abeg.
Re: A Thread For Tutorial On Python Programming by ositadima1(m): 2:27pm On Sep 24, 2020
Make I post small code way I write this morning. He get site way get some PDF file way I won analyze but d PDF plenty and I no get strength to begin dey download am one at a time. So I write code for am.

import requests
import bs4
import os

res = requests.get('http://www.nse.com.ng/market-data/other-market-information/foreign-portfolio-investment-report') #to grab d site HTML
res.status_code == requests.codes.ok #to make sure wahala no dey

mySoup = bs4.BeautifulSoup(res.text, 'html.parser') #to parse the HTML
elem = mySoup.select('td:nth-child(2) > a:nth-child(1)') # I use CSS selector to locate all d download links
linNse = 'http://www.nse.com.ng'

fileLis = [] # returns a list contents within the directory #In case I download halfway this code nah to keep track
for file in os.listdir(r'C:\Users\ounegbe\AppData\Desktop\work\python\WPy32-3740 old\notebooks\Stock Tracker\Domestic and FPI Report'):
fileLis.append(file)

for ele in elem:
test2 = ele.getText() + '.pdf'
if test2 not in fileLis:
repPdf = ele.get('href')
repNse = linNse + '%20'.join(repPdf.split(' ')) #I do small text formatting make the link pure
print(ele.getText()) #make I dey see wating dey happen
test = 0

while test == 0:
try:
res1 = requests.get(repNse)
test = 1
except:
print('Bad')
imageFile = open(os.path.join('Domestic and FPI Report', os.path.basename(ele.getText()+'.pdf')),'wb') #U go create the folder manually first
for chunk in res1.iter_content(100000):
imageFile.write(chunk)
imageFile.close()
else:
print(ele.getText()+'exists')


D thing pure and him dey work wella. I love python, he too much.

2 Likes

Re: A Thread For Tutorial On Python Programming by llade(m): 8:29pm On Sep 25, 2020
Am in wanna ace this python language.
Re: A Thread For Tutorial On Python Programming by Nobody: 10:41pm On Sep 25, 2020
Hmm.
Do you have 1,200 naira? Then send me text on 07032993652 to know how you can make over 2,000,000 naira in six months with our company. Thanks.
Re: A Thread For Tutorial On Python Programming by muthm: 8:59am On Sep 26, 2020
This is excellent.

I have Python 3 lessons on my blog and youtube channel too.
Re: A Thread For Tutorial On Python Programming by shgenius123: 10:49pm On Oct 01, 2020
I'll need this. thanks in advance
avalon7:
I have full "Python for research" course from Harvard including videos and assessment if you are interested like and quote... The number of likes would help me determine how interested people are
Re: A Thread For Tutorial On Python Programming by Hendris(m): 5:15am On Oct 03, 2020
Do you have a smart TV or andriod and iPhones? Subscribing to Netflix for Nigerians has been made easier, I sell Netflix Premium accounts at a very affordable price and I have accounts ranging from 1month to 2year subscription fully paid..

1month is 1500
3months is 4k
1year us 8k

Drop your WhatsApp number if you are interested or contact me on 081...311..231..93

(1) (2) (3) ... (20) (21) (22) (23) (24) (25) (26) ... (32) (Reply)

Chronicle Of A Data Scientist/analyst / I Want To Learn Programming. Which Language Should I Start With?

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