2019-06-29 02:58:31

Hello everyone,
So you may recall I released a number of python tutorials that were a beginning to a series on "how to code in python."
I have, since, remastered these, turned down the volume, and re-recorded the tutorials to make them a bit more concise.
I have also recorded the 7th tutorial, which concludes the entire first section.
In short, I believe at least, I have mangaed to create tutorials that will teach you how to code in python.
I have given them a separate link on my website and improved the layout to be more accessible, so the only thing for me to do now is say:
Have fun, and, I hope they help someone, somewhere. smile
https://www.nathantech.net/products/tut … /index.php

Nathan Smith
Managing Director of Nathan Tech
It's not disability
It's ability!

2019-06-29 03:25:37

Hi, when I click to download part 7, it says the file can't be found, but, the first 6 did download with no problem.

2019-06-29 03:40:05

cant here your speach. but still, thanks

I am a divine being. I can be called a primordial deity, but that might be pushing it, a smidge. I am the only one of my kind to have ten tails, with others having nine. I don't mean to sound arrogant, but I have ascended my own race.

2019-06-29 07:20:20

i cant download the 7th one about modules

2019-06-29 12:50:44

Hi!
I aparrently forgot to upload the 7th file. It is now up.
Sorry about that. A product of being tired, I think.

Nathan Smith
Managing Director of Nathan Tech
It's not disability
It's ability!

2019-06-29 19:49:27

i highly Apriciate it...  The background music was noisier previously. Now it's fine but, i would suggest you  to use only one jeneric music before you start talking then do not use background music or use something smooth with lower valume.

2019-06-30 03:35:17

Thanks a lot for the tutorials.

2019-06-30 16:05:57 (edited by Quin 2019-06-30 16:06:21)

Hi. Thank you for making these. I am finding them to be quite useful. However, where i am stuck is at the end of the second recording, I'm not exactly sure how to print from a dictionary.
so i have:
d={}
d["name"]="Ty"
d["name"]
and that works fine. But when i add this line:
print(name)
Traceback (most recent call last):                                                                                        File "<stdin>", line 1, in <module>                                                                                   NameError: name 'name' is not defined                                                                                   
What am i doing wrong?

2019-06-30 16:14:16

Hi there.
Name is a key of the dictionary d. Where as you are trying to print a variable called name.
Instead, you want to do:
print(d["name"])

Nathan Smith
Managing Director of Nathan Tech
It's not disability
It's ability!

2019-06-30 16:31:02

@9 thank you, it worked!

2019-07-02 01:13:07 (edited by abdulla-dubais 2019-07-02 01:14:28)

hi
First: I would like to thank you for these tutorials
I have a problem: In the third lesson I wrote the code and put it in a .py file but I get errors when I run the file
Someone told me that I should put tab after each line and the problem still shows me errors
That's what I wanted to do: I hope someone helps me
if(number==1):     print('hello'):    else     print('good bye')
thanks.

2019-07-02 03:20:24

Mmm...
Ah. First, remove the parentheses around your if statement. That is not required for this kind of statement right  now (unless its a very long statement). Second, remove the colon after your print statement and put it after the else. Third, divide the statement into multiple lines, i.e.:

if number==1:
    print('hello')
else:
     print('good bye')

You also should not indent your else. This isn't a part of the if block and your code isn't inside another block.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2019-07-02 12:07:42

Hello.
Ethin told you the solution pretty much as i would have.
I admit, more from previous languages than anything, I myself have a nasty habit of putting parenthases around statements that don't need them, such as if statements.
Remember that if, elif, and else should have colons after them, but calls to functions and such do not.

Like so:
number=1
if(number==1):
print("Hello, your number is one!")
elif(number==2):
print("Hello, your number is 2.")
else:
print("Um... What number now?")

Nathan Smith
Managing Director of Nathan Tech
It's not disability
It's ability!

2019-07-02 13:26:05 (edited by Still_Standing 2019-07-02 13:29:47)

these are useful   , thanks for making them
at post 13, i'm having  this problem 2 smile

And as anyone who's gone mountain climbing knows ,The serene snow-covered peaks that look so tranquil from a bdistance, Are the deadliest
sound is my vision
i rarely check my private messages on the forum, so if you want to contact me please use my email, or dm me  at oussama40121 on tw

2019-07-02 16:47:11

Thanks a lot for these

2019-07-02 17:31:29

Ok, so i'm stuck in the fifth recording.
here's the code
def test(x):
n=0
while(n<x):
    print(n)
test(2)
It says that i need to indent line 2. But when i do that, i get a traceback.
like this
def test(x):
    n=0
while(n<x):
    print(n)
test(2)
What am i doing wrong?

2019-07-03 02:44:20

You need to indent the while statement, then double-indent the statements within the while.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2019-07-03 23:43:01 (edited by dardar 2019-07-03 23:43:46)

Hi @16!
It comes back to indentation.
Remember, we indent in python so that the machine knows what code runs inside what loop. Like so:
def test(x):
    n=0
    while(n<x):
     print(n)
     n=n+1
test(2)

Nathan Smith
Managing Director of Nathan Tech
It's not disability
It's ability!

2019-07-04 18:19:09

God. I'll never get passed the loops. I'm just scared of crashing my PC do to me being stupid and making a loop that loops forever. I'm just scared of continuing the recording. I already crashed my PC but I turned it off as fast as possible.

2019-07-04 18:36:49

I cannot wait until the next part of this series comes out. Thank you for the tutorial, I appreciate them and I found them all to be very informative. I love a challenge, and I welcome python with open arms. MuaHaHaHaHa.  Once again, thank you very much.

Their is no such thing as a master.  One is never done learning, and those who claim to be a master at something are far from becoming one!!

2019-07-04 20:17:19

Yeah, i did that too with functions.

2019-07-04 21:49:14

Hi there
@charles.
I speak in the tutorials about a keystroke that saves computers, it is control c, or, for mac, command c.
Lets say you type this into your terminal:
python
while 1:
print('you suck')

What does this do?
It creates a loop that will endlessly print you suck to the console, over, and over, and over again.
Now if you run this, then press control c in the terminal, it creates what is called a keyboard interupt, and stops the loop.
HTH

Nathan Smith
Managing Director of Nathan Tech
It's not disability
It's ability!

2019-07-04 22:45:19

Yeah but I was using a file. Not the CMD

2019-07-04 22:48:19

I cant wait for the other part to be finished. Let's see what game your gonna make :-D

2019-07-04 23:22:30

i was in cmd, and tried control c, but i couldn't do anyhting. My NVDA completely died as well.