Welcome, Guest: Join Nairaland / LOGIN! / Trending / Recent / New
Stats: 2,548,981 members, 5,872,092 topics. Date: Tuesday, 22 September 2020 at 06:54 PM

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

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

Common good python programming practices you should know / A Thread For Tutorial On Graphics Design. / I Have A Very Import Question On Python Syntax (2) (3) (4)

(1) (2) (3) ... (20) (21) (22) (23) (Reply) (Go Down)

Re: A Thread For Tutorial On Python Programming by FunctionX(m): 1:07pm On Aug 30
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
Re: A Thread For Tutorial On Python Programming by SirMichael1: 3:38pm On Aug 30
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
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
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
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
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
I promise I will follow every step
Re: A Thread For Tutorial On Python Programming by jidejado(m): 7:51pm On Sep 10
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: 9:20pm On Sep 10
Re: A Thread For Tutorial On Python Programming by peacettw: 4:09pm On Sep 11
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

2 Likes 1 Share

Re: A Thread For Tutorial On Python Programming by TypeSafe: 9:47pm On Sep 11
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
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
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
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
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
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
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
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
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
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
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
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.

(1) (2) (3) ... (20) (21) (22) (23) (Reply)

Why Waste 4 Years On Computer Science In University? / Freely Download Music, Videos, And Games All In One Place / 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 - 2020 Oluwaseun Osewa. All rights reserved. See How To Advertise. 85
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.