#pedagogy

1 messages · Page 7 of 1

bleak lantern
#

mini whiteboards and tree drawing next week i think

pine stratus
#

Since almost everything in CS can be drawn as some kind of tree I like to get that mindset set in, especially for recursion later.

bleak lantern
#

this was also a problem in this year's bebras challenge - the tree thing

#

i wonder if i can find it...

#

nah - i can't find it - i think they're locked away for a while

grand storm
#

I was just presenting an alternative view to a very black and white statement. I presented a different approach and how it can lead to different outcomes

#

I start with ipython

#

Then again most of my students are older and want to be developers. I then teach them the help and dir functions and we use those to explore around some of the built in functions, and they learn how the namespaces work and how they pull tools in from different places. Then I show them how to do basic arithmetic, then I show basic functions with arithmetic, then I show tests for those functions with doctests

#

Not all in one session of course. I find this gives them a very good foundation for working with python in a practical way, being able to see some module, pull it into ipython, dir, oh that looks like what I need, help it, ah so it has those params, write a function, etc. Test when it's done and your good to go. And the thing I tend to have them build is a terminal calculator

#

Idk if that will work for younger students though, I assume a good amount of prior knowledge about mathematics

bleak lantern
#

What are the errors students often make to start with? Or what are the things they misunderstand?

bleak lantern
#

true - i dont go near those for a long long time

weak mortar
#

Even normal var scope people get confused with. Having it shadow outer vars. When you assign a var inside a function you can't access it in another func.

bleak lantern
#

so what's a good way to teach variable scope?

simple olive
#

I've seen very senior engineers not know how scope works especially for for and even more especially so for with

#

My thoughts on this are that function scope is easiest to learn, then class then global

#

So get students into:

if __name__ == "__main__":
    sys.exit(main())

Mode as asap as possible, and get all the code into main and no global state

#

For teaching nonlocal, start with the python 2 syntax - appending and popping from a list

jolly night
bleak lantern
# jolly night for your students, what part of variable scoping is important to understand. I'l...

so the things I need students to understand are:

  1. (not really scope) the fact that in a subroutine, the variables there are not the same variables that are outside the subroutine, even if they have the same name - I need them to see functions and procedures as being a safe space, so that decomposition and abstraction make sense
  2. local and global - i tend to leave this for the higher grade students who are properly geeky about the topic, who have a need for global variables. I don't do this until students are about 15/16
  3. Class variables and instance variables and the like - i just tend to keep OO out of the classroom for the age I go to. I touch on it for really advanced students, but it's not assessed.
#

I love analogies and ways to make abstract ideas concrete - so even the idea of functions and procedures is curious - how can we make those easy to understand?
I refer to function machines that students have done in primary... but I'm not totally convinced.

I almost wonder if i need an analogy of... i dunno - using lots of calculators? it's very weak though - I wish i had a better one.

#

My best anaolgy for subroutines is using python turtle. I get students to make a proc for a brick, and then a proc for a brick wall (made of bricks) and then one for a whole house / castle wall. Lots of reuse. But I don't think the idea works well outside of drawing stuff

jolly night
bleak lantern
#

fair enough

jolly night
#

maybe an analogy that would work for functions is an assistant. You're the boss, and you have a big job to do. There are parts of it you hand off to an assistant. You say, "i don't need to know the details about how you do this, just do it and bring me back the result."

bleak lantern
#

yeah

#

my models are really weak with functions and procedures

#

even the idea that a return and a print are really very different things can elude them

#

maybe an assistant... hmm

#

maybe a black box... you put things in and something comes out?

#

and you don't know how and don't need to know?

#

i'm even weak on explaining that something can come back from a function to be honest. I think students get it but explaining these ideas can get so abstract sometimes that i wonder if i make any sense

#

That's my self doubt talking now!!

jolly night
worldly dewBOT
#
Print and return

Here's a handy animation demonstrating how print and return differ in behavior.

See also: /tag return

jolly night
bleak lantern
#

i tend to use the debugger in Thonny as it shows the values moving from one thing to another... but it's still not ideal

#

i dunno

misty dirge
#

@late finch please go to #bot-commands

noble topaz
prime prawn
#

what do you suggest?

grand storm
#

I've seen so many students use a for loop to construct a list of a comprehension and then throw the list away

jolly night
grand storm
#

Or make a mess with decorators because they're nifty when all they needed was a few normal functions

grand storm
jolly night
grand storm
#

Closures too, I've had a couple students use closures and make a mess when they really just wanted a class

grand storm
#

But especially python because it's so featureful, you almost never have to hack together a basic feature, and when theyre coming from something else, they will often try too

dusk gorge
prime prawn
#

@grand storm I disagree mildly with your agenda, to prevent students from doing things the wrong way. providing them with proper feedback is golden

grand storm
grand storm
prime prawn
#

@grand storm in my opinion, in a learning environment, doing things the wrong way is nothing that needs to be avoided. It only reflects what the student needs to learn, was that clearer?

grand storm
prime prawn
#

exactly 🙂 nice that we share this understanding

grand storm
#

I guess I'm not saying they can't do it wrong, but moreso that that's what's commonly done wrong before it's corrected

dusk gorge
gentle hound
misty dirge
gentle hound
#

I am not native speaking and I mean it as a Noun

#

Calling a procedure a function is simply not true, so I think calling it that is fundamentally incorrect

#

I like 'block' or 'code block' - while it seems to be too generic

#

maybe cell. that would work well with how Alan Kay saw programs as an analogy of how cells communicate with each other.

#

code cell, although this clashes somehow with Jupyter

misty dirge
gentle hound
#

Well, even better

pine stratus
#

While many languages call them functions, procedures is the more correct term, and it's also probably easier to understand (the term is used the same way outside of software).

#

(Unless it's some functional programming language where they are pure)

bleak lantern
#

i need to use the terms function and procedure

#

yeah - it's tricky to think of a good analogy... things going in and things going out. things being "called". things being defined.

#

i'm sticking with function machines for the moment

grand storm
jolly night
grand storm
#

the classical example is the function f(x) = x + 1

bleak lantern
dusk gorge
grand storm
#

given the same x, it will always produce the same output

jolly night
grand storm
#

something like f(x) = x + 1 has not side effects

pine stratus
grand storm
#

it just takes something in and returns something out. it doesnt ever change in operation unless by means of the argument passed in

jolly night
bleak lantern
grand storm
bleak lantern
#

cqs?

pine stratus
# jolly night different languages use the word slightly differently.

So all of the languages like C, C++, Python, etc are all kind of copied off of each other and are in a sense decedents of ALGOL, which used prcoedure (proc). Pascal kept the name procedure, but somewhere one used function IDR which. Some new languages in this family of languages are now switching back to procedure, but now we have both terms being used interchangeably. IDR which languages had both, where functions where pure.

#

Basically a function in Python can be either a function or a prcoedure. If it has side effects it's not really a function.

bleak lantern
#

hmmm - history is interesting, but i need to teach a function as being something that has a return value, and a procedure as something which doesn't

pine stratus
#

Procedures can produce some result. Like a procedure to create a car.

#

Functions are specifically about mapping one to one.

bleak lantern
#

maybe you have a different definition you need to follow then

jolly night
pine stratus
#

In Python you produce some end result from the procedure.

jolly night
pine stratus
#

So if you have a procedure that maybe does some IO, like a read a file, but maybe that file is not there, it can break the one to one mapping.

#

An input (the same one) can result into two different outputs.

jolly night
pine stratus
jolly night
pine stratus
jolly night
pine stratus
#

I prefer procedure for teaching since it's less mathematical, and has usage outside of math and programming, meaning the same thing, a list of instructions to be followed.

#

Something that can be handed off to a person to execute and come back with a result (and also have side effects), making for something that can be done as an exercise (IRL with pencil and paper).

#

I then explain that in Python we call them "functions."

simple olive
#

My understanding is that procedures can't be recursive

bleak lantern
#

I'm specific about functions needing to return a value, simply because that's how it's examined at high school in the UK.

#

If they don't return a value, we call that a procedure, and students in the UK are expected to know that.

#

I call the general version of these two a "subroutine"

simple olive
#

? All functions return a value

#

Unless they don't terminate (eg loop or crash)

native hearth
jolly night
#

there are no terms that are universally used exactly the same way across all programming languages.

native hearth
#

it'd be nice if they didnt mean the exact opposite though

jolly night
native hearth
#

Subroutine being the general term and procedure being the non returning term in vbnet
Vs
Subroutine being the non returning term and procedure being the general term for pascal

#

I only used vbnet as an example because its what was taught in the UK when i was doing the cs exams

jolly night
#

yeah, i see.

bleak lantern
bleak lantern
gentle hound
#

If thats new to you, I highly recommend to read something on it. Pure functions are the base of functional code. Mutating things needlessly is a common source of errors for primitive code.

simple olive
bleak lantern
#

i get it that some history buffs can point to some weird examples where a byte isn't 8 bits... but that's way beyond normal education. there's no way i'd chuck something random and obscure in without good reason. (Tbh i don't even mention the kibibyte)

jolly night
#

no one knows the term "Kio". Even people that have heard of "Kibibyte" don't use the term.

tame dagger
#

I'm one of those people. ^

simple olive
#

If someone corrects you to kibibyte it's always worth countering with kibioctet

thin saffron
#

I was wondering how to approach teaching safe integer conversion to beginners. Now, there are the string methods, right, but they can report False Negatives or - worse - False Positives for what can be "cast" to an integer. The typical approach is to just try/except ValueError, but that seems a bit too advanced of a concept to teach at an early stage, unless it's shown without explanation. Another approach could be regex I suppose, but I mean... that's not simpler than error handling with try/except and is still prone to logic errors. So, do you just teach them to use .isdigit at first and then later move on to try int(...)/except ValueError or do you explain this error handling syntax for this particular case and then proceed with whatever next topics you have. Because if you give them a task of making some simple CLI for practice, it will likely involve input validation, though I suppose that part could be skipped until later to then be able to introduce them to try/except first.

stone jetty
jolly night
stone jetty
#

I personally wouldn't do the custom function thing, though it depends on the student. I always found it a bit offputting as a beginner when I have the feeling that I'm being given a black box on top of the language and expected to just accept it

#

I think there's no reason to avoid the crash, it's good for them to see how python crashes

jolly night
#

it definitely depends on the students, and what you are trying to teach at the moment.

bleak lantern
# simple olive If someone corrects you to kibibyte it's always worth countering with kibioctet

if someone corrects me to kibibyte? corrects me how?

I don't do conversations like that.

I just don't imagine the context where I'd be discussing the size of files and someone would say, ... "oh actually that's not 1048kB, it's 1000kiB - it makes much more sense"... and I certainly wouldn't then say, "oh you surely mean kio? if you say kiB, then I'll be furiously confused as to which version of a byte you mean..."

I don't see it happening. I've had stranger conversations though.

hazy mirage
bleak lantern
thin saffron
#

I was just thinking about tutorials the other day and this question came to mind since typically tutorials suggest using one of those string methods, but like, that's obviously not what should be used and so I was wondering what a better approach would be instead.

subtle owl
thin saffron
#

I would think that the target audience in this context is likely either first time learners or students (are those groups that different from one another?). If it were entry level engineers, I'd probably just tell them about try/except and explain that the string methods are not meant for this.

bleak lantern
#

Well - I'm not really sure what it is you're trying to get them to understand myself.

#

I think being really clear is the first step.

thin saffron
#

I just happened to think of this the other day and how tutorials typically IME suggest using string methods, I was just wondering how to approach the whole thing better

subtle owl
# thin saffron I would think that the target audience in this context is likely either first ti...

I consider them as quite different given the intent:

  • A. First time learners are yet to develop computational thinking skills and learning about the fundamentals of programming/algorithms
  • B. Students imply student in CS. Which means the end result of their studies will be to become competent entry level engineers and are already somewhat further than A and will learn more than just python.

At least, that's the framing I am using here for the sake of this discussion.
This means that for A. I would use whatever minimizes the cognitive load so that they can focus on one concept at a time. Not much of a reason to worry about these distinctions when you are still trying to put together your first algorithm.
For B. I do see your question as far bigger than try/except vs string methods. This is about correctness and defensive coding practices. Potentially going all the way to Hoare Logic. This could be done in a dedicated module or in passing, along the way.

bleak lantern
#

cognitive load is always an issue regardless of audience

#

Just need to know what they know.... and what you need them to know next - if it's too much of a step, they won't be able to learn it

runic oracle
#

Hello, I'm a beginner in Python programming and I need some help. I'm trying to create an animal simulator and I'm currently working on the movement of my animals. I want to do something simple like move all rabbits to the right cell next to them and all foxes to the left cell next to them. Can someone explain how to do this using a Python function or something similar?

stone surge
#

um try using pygame for graphics

#

and use the set x and set y and use a changing variable

tame dagger
steep schooner
#

when i install a module for python, do i have to install it twice? one for he os and the other for the IDE? I use Mu Editor for now and I find that when Install a odule with pip install in the terminal Mu Editor don't automatically recognize it. I am on macos btw.

misty dirge
silent goblet
#

Is there a good way to teach the hashability requirements in dict/set without explaining how hash tables work in detail? You know, if you're introducing dictionaries, and need to explain why certain objects cannot serve as keys

misty dirge
#

and I don't think I've ever seen a custom __hash__ implementation that wasn't just passing an immutable instance attribute (or a tuple of them) to hash.

#

So I think it suffices to say "barring edge cases that you are very unlikely to encounter and which probably shouldn't exist, dict keys and set elements need to be immutable, or a tuple (or frozenset) of immutables"

silent goblet
#

maybe it's fine to say that the reasoning will come later and is not that important?

misty dirge
# silent goblet 🤔 I guess, though that doesn't explain why it needs to be immutable

you can do a thought experiment with the student: suppose python allowed lists to be used as dict keys. If you use a list x as a key for value y, and then modify x, which of these keys should yield y? (1) the x object itself only, (2) any list that evaluates to the value of x at __setitem__ time, or (3) any list that evaluates as equal to the current value of x?

You avoid the whole issue by not allowing mutable dict keys.

silent goblet
#

Yeah, perhaps

simple olive
thin saffron
misty dirge
thin saffron
#

Oh, I see what you mean

atomic rose
#

Hey you guys heard about soy_bean

graceful kernel
#

Hello , who can help me ?

graceful kernel
trail lark
long aspen
#

hey guys, can you give me some feedback about my github page? I am a freshman but have some projects

formal loom
long aspen
long aspen
formal loom
#

Look good

long aspen
worldly dewBOT
#

:incoming_envelope: :ok_hand: applied timeout to @jagged tree until <t:1734247415:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

The <@&831776746206265384> have been alerted for review.

tame dagger
misty dirge
#

@manic dust hello, please remove your message from this channel and ask it in #tools-and-devops

bleak lantern
#

So today i took the approach with age 13s of getting them to copy down some code into Thonny and make it run.

#

The code was simple:

print("Hello, what's your name?")
name = input()
print("Nice to meet you",name)

#

What do you think the most common errors were?

jolly night
bleak lantern
#

very few quote errors (occasional missed quote)

copper cosmos
#

space before parenthesis

bleak lantern
#

I also said they needed to press F5. (And a drew a picture of a keyboard and pointed to where F5 is, because otherwise they type F then 5)

copper cosmos
#

Capital Print

bleak lantern
#

amazingly NO capital P on print

#

surprisingly the most common error was the second line.

They all put their own name in the brackets of the input!

bleak lantern
#

I was really confused why that happened.

copper cosmos
#

It makes sense, they are used to filling in forms

#

In fact, so many people change their DNS records to point to domain.com because that is the example in the books... that Bill Woodcock registered the domain and returns a helpful error message.

bleak lantern
#

reducing errors always interests me

#

so i used a red pen to underline things they would get wrong

#

and told them so

copper cosmos
#

I wonder, how did they feel about the red pen? Did it help to see that the mistakes were common?

bleak lantern
#

no idea how they felt - i didn't ask

#

the mistakes i usually see changed a lot

#

because i told them what mistakes i expected and so they paid extra attention to those

#

later i included an if statement and only 3 people in 150 missed the colon

bleak lantern
simple olive
#

The overall instructions were to copy out some instructions, but instead they followed the second nested set of instructions

simple olive
bleak lantern
#

which is something i'll learn from - but i don't quite know what i'd do different...

simple olive
#

This is a major problem in ChatGPT/Claude/LLMs in general

#

They can't distinguish data from instructions

#

I also have trouble with similar stuff like the instructions to run: python -m venv path/to/your/project/.venv

bleak lantern
#

oh i've not tried it with getting an AI to do it, just students

simple olive
#

I've given up on that and either ask for the directory, and have a fun game trying to navigate a filesystem, or get them to create the environment with vscode which often creates the 'wrong' python version environment

simple olive
bleak lantern
#

ok

simple olive
#

the "ignore previous instructions and ..." thing, generally trips up LLMs

#

Probably will trip up students no matter what prompt you put above the code

bleak lantern
#

so in a class situation... and you're introducing variables and using input...

#

would you pick variables which don't give instructions?

simple olive
#

I think go the other way

bleak lantern
#

e.g. i could have used n rather than name

simple olive
#

And introduce a intentional confusion possibility and use it as a learning exercise

bleak lantern
#

how would that help?

#

given that they're already mostly confused

simple olive
#

You could even introduce this concept with a game, like Simon say's

pure condor
simple olive
#

Well certainly don't do that!

#

Use a different coding example that uses input and globals etc and has 100% coverage

#

The actual code isn't important, the practice in writing something down and getting it the same is

worldly dewBOT
#

:incoming_envelope: :ok_hand: applied timeout to @tiny heath until <t:1735229586:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

The <@&831776746206265384> have been alerted for review.

bleak lantern
#

bet it wasn't even pedagogy related

devout cobalt
#

whats pedagogy

#

<@&831776746206265384>

rain radish
#

why the ping?

devout cobalt
#

o

rain radish
#

From the channel description: "Discussion of the methods and practices of teaching"

devout cobalt
#

no sorry i saw it and i couldn't resist lol

rain radish
#

Please don't ping us like that again, unless somebody is breaking our rules

devout cobalt
#

ok

carmine rose
devout cobalt
carmine rose
#

nah that’s not me, I don’t even know who that is man 😭

zealous gyro
#

👍

severe wasp
#

Hello, I don't know if this is a right channel for this or not, but still, I'm gonna give it a try.
Around 6 months ago, I had to introduce binary system, encoding and ASCII table to other people and kids who are new into that stuff. But instead I taught them how computers actually work. Instead of telling them that computers use 1s and 0s as their language I explained what those 1s and 0s mean and how computer components work together. Is that okay?
I thought that telling them "binary is just bunch of 1s and 0s" was stupid or boring. So I told them that there is actually logic behind that.
And no, I didn't just start teaching them whole assembly language, I showed them real examples with real circuits, I showed them how basic logic gates work.

#

I feel kind of guilty for not following the instructions I had.

grizzled storm
severe wasp
#

not officially

grizzled storm
#

but in any case it's really fine mistakes are fine with teaching and you still taught them something and you probably learned that next time you should just teach them the boring part but in this case it sounds like all that was happened is that they learned something interesting

severe wasp
#

well, when I said boring, I meant, it sounds not so useful. Many people here when they hear the word "binary" they automatically think it's some ultra dystopian science fiction that no human can understand, and teaching them that it's just "a bunch of 1s and 0s" doesn't make much sense.

#

I would rather explain the logic behind those 1s and 0s

grizzled storm
#

understandable

#

what was the age group of the kids/people

severe wasp
#

mixed, from 9 to 40+ I guess

#

it was kids, their parents, students and other people

grizzled storm
#

9-40+ sounds like a near impossible age group to learn something at the same time at least for something like that

severe wasp
#

well, I did have to repeat some stuff, but I tried my best to make it understandable for that group of people

grizzled storm
#

repeating stuff for 9 year olds is really normal

severe wasp
#

yeah, it was not my first time being with them

next ginkgo
#

Hello guys, sorry to disturb you all, can someone suggest a good resource where I can learn data structure and algorithm please. I want to learn things well, from the basic of Big O notation to time complexity and the different algorithms that exist please. (please bip me if any one know some good resource, would really be grateful :c)

orchid sapphire
#

@next ginkgo the best way to learn that topic is to work on LeetCode type problems. Do things hands-on, and do a lot of it

#

Reading a book on the theme helps, but you're not likely going to Grok the knowledge without some practical experience

#

Hands-on first, theory second

next ginkgo
#

alright, thanks !

tame dagger
sudden sonnet
#

hi guys! i started learning code and i decided to do a project for a mini profile card with some details. can i do this code even better? should i add more details???

#
print("Step 1: ")
name = str(input("Enter your name (Without Surname): "))
print("Step 2: ")
surname = str(input("Enter your surname: "))
print("Step 3: ")
age = int(input("Enter your age: "))
print("Step 4: ")
hobby = str(input("Enter your hobby: "))
print("Step 5 (last step)")
work = str(input("Enter your work: "))

print(".......... Mini Profile Card ...........")
print("Name :", name , surname)
print("Age :", age)
print("Hobby: ", hobby)
print("Work :", work)
severe gull
bleak lantern
meager pier
#

what is pedagogy

simple olive
meager pier
stone bear
#

i love doctest though

queen vault
#

Can I create an image processing project using Django?

misty dirge
misty dirge
#

What do you think about teaching print(f"{a = }") syntax as a debugging technique @main ridge ?

main ridge
# misty dirge What do you think about teaching `print(f"{a = }")` syntax as a debugging techni...

Mixed feelings. I see so many people going print(f'.... huge format here ....') when everything they're doing is typically {name}, which is just str(name), which is what print(name) does for you for free.

So I've an ingrained resistance to using format strings in print() altogether. Probably a little excessive.

The {name=} format is very handy, I've even found myself using it recently 😦

main ridge
misty dirge
main ridge
#

I'm using f-strings in exception messages a lot.

main ridge
# misty dirge I use `f"{x = }"` syntax in pretty much every error message that I write. though...

FYI:

CSS[~/hg/css(hg:default)]fleet2*> ag '[a-z]=}' cs/**/*.py
cs/app/osx/objc.py
102:              b"^{__CFArray=}i",
111:          CGSGetDisplayForUUID=b"I^{__CFUUID=}",
116:          b"^{__CFDictionary=}Ii^{__CFString=}",
118:          b"vI^{__CFDictionary=}ii^{__CFString=}",

cs/distinfo.py
1763:      raise GetoptError(f'unknown {pkg_name=}') from e

cs/ebooks/pdf.py
1413:        raise ValueError(f'start out of range, expected 0<={start=}<{nobjs=}')
1416:            f'count out of range, expected {count=}>0 and {start=}+{count=}<={objs=}'

cs/hashindex.py
188:      warning(f'{hashname=} not known: {e}')

cs/hashutils.py
59:              f'unknown {hashname=}: {import_e}; {sys.path=}'
62:        raise ValueError(f'unknown {hashname=}: {hashlib_e}')
95:              f'class {hashcls.__name__} already exists with a different hash function {hashcls.hashfunc} from supplied {hashfunc=}'

cs/naysync.py
640:                f'{concurrent=}',
641:                f'{unordered=}',
642:                f'{indexed=}',

cs/vt/__init__.py
437:      raise ValueError(f'{h=} != {self.hashclass.hashname}({data=})')
round wing
simple olive
radiant sandal
#

I like to teach like this: either you get everything right on the test, or if you make at least one mistake, you get a zero. Even those who fail know a lot about Python. I think that if we had a gun with rubber bullets it would work better on the students, what do you think?

true nova
radiant sandal
#

I allow the use of GPT, so there is not that much pressure. After all, they will use GPT even in the workplace. However, I try to do tests that GPT would not respond well to.

grizzled storm
south gorge
#

Indeed seems like trolling, or a very very bitter "teacher" who nobody would wish for

forest light
magic cove
#

hi i am studying python, how do you deal with the frustration when the most simplest things are the most difficult for you, any advice (I started 2 months ago ) I would apreciate it, thanks

misty dirge
robust bluff
#

JOY OF PROGRAMMING - Software Engineering Simulator is an immersive 3D programming puzzle game about automating and controlling realistic machines, robots, drones and more using real Python code. Build actual coding skills while playing, solve exciting bite-sized programming challenges and progress to unlock new programming features and improved...

Price

$12.24

Recommendations

167

▶ Play video
north oasis
#

I'm working on a combined curriculum for algebra and intro python. I want students to be able to tell python to graph inequalities on a number line. Is there a module with this functionality?

misty dirge
north oasis
zinc ginkgo
random topaz
#

!rule 6 9 Please stop advertising around the server.

worldly dewBOT
#

6. Do not post unapproved advertising.

9. Do not offer or ask for paid work of any kind.

thorny nova
#

frieren

outer bobcat
#

Fein

knotty lintel
#

Hi I'm looking for someone who's from finance background

sudden dew
knotty lintel
#

@nova heath hi

nova heath
#

@knotty lintel hey please post the question in an off topic channel. Not careers or pedagogy

knotty lintel
#

Where bro?

misty dirge
#

!ot

worldly dewBOT
tidal stream
#

I am moving on from Python basics into intermediate stuff, just recently getting a grasp on OOP as the last topic in CS50's course. I was going to work through Automate the Boring Stuff, since it seemed like a resource to learn scripting with Python. I'm starting it, and it says it is for complete beginners. Is there a better resource? is it worth going through if I'm not a complete beginner?

misty dirge
earnest vault
#
#

Feedback is welcome.

versed quarry
#

Oo

keen pawn
#

I have an interesting question for y'all. I have a project where I have a long running server which is connected to some embedded devices. I have created Classes for some of those devices that act as a machine abstraction layer allowing the initiation and ending of tasks or poll for updates on the data.

I want to create a method that will output html for the class including forms for the methods in the class but for this I need to do some runtime reflection. Does anyone have advice for the usual go to methods or even simplified methods of doing this sort of thing? Thanks everyone 🙂

jolly night
keen pawn
spice island
copper cosmos
#

I had a bit of an epiphany yesterday, while describing ensemble (mob) programming to someone and they asked what the minimal level knowledge should be. It strikes me that rotating the roles of driver and navigator woud be a great way to introduce a lesson to a group of beginners.
Is this already a thing? Has anyone here tried it?

neon pasture
#

I have seen people report good results using pair programming to spread knowledge across their employees, usually in the context of adopting new languages. This seems pretty similar.

worldly dewBOT
#

:incoming_envelope: :ok_hand: applied timeout to @weak mortar until <t:1738852097:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

The <@&831776746206265384> have been alerted for review.

steady comet
#

can someone help me out in this
We are working on a api hosting
Well to get you a clear idea , let me explain it to you ...

i) We will have a script or smth that will req a url and get a csv file from there and then perform insertion in the database ( we will use github actions for that).

ii) then the database problem comes up ... we will be having 11 gb of data insertion each data (so which least costed database should we use)

iii) then we will have a backend server (django apis) or smth which will be api endpoints and it will perform data retrieval from database and i guess we were thinking to host it on vercel

molten meadow
#

Is someone up for pair programming?

tame dagger
copper cosmos
merry tulip
#

🕑 Estamos gerando seu Ticket...

#

||||

misty dirge
#

!ban 1087869811972919379 selfbot

worldly dewBOT
#

:incoming_envelope: :ok_hand: applied ban to @merry tulip permanently.

nova geode
simple olive
nova geode
#

yeah alright

coarse mist
#

One person tells the other what to do and they do it with their skills and the other person can watch and learn. Driver Navigator roles.

simple olive
coarse mist
#

Oops. Looks like I did it in reverse. 😂

simple olive
#

There's not supposed to be much telling what to do

#

Well

#

I mean it's not required that someone is telling someone else what to do

#

That may be a teacher student pairing, but I associate pairing with one person looking things up one person typing, and both people collaborating on the project

nova geode
#

To be honest when I heard pair programming i thought of just 2 people programming next to eachother on completely different projects or in call giving advice to the other when requested

misty dirge
#

Does anyone want to talk about how pair programming could be used as an education technique?

nova geode
#

people already do i think

misty dirge
nova geode
#

seems good

#

I think it would be quite effective

#

Although I think the main thing beginners should know is how to find answers online and read documentation for functions, libraries, etc and to do that sort of research as the teacher in pair programming would be helpful

misty dirge
#

We did pair programming in my first programming course. I didn't see the point of it. Especially since we were both equally ignorant.

nova geode
#

I think it probably depends on the project

#

But in the typical sense of having someone watch over you coding and discussing i don't think it would help me much personally

#

it would be much more effective to have them working on a different part of the project on another system

pine stratus
#

The context in which it's useful seems limited, but for onboarding it does seem a like a decent idea, for a bit.

#

Beyond that it's probably better to work in parallel and use other tools like version control.

nova geode
#

two beginners programming together sounds like the blind leading the blind

simple olive
royal dove
next ginkgo
#

Hello guys, sorry to disturb you all... I need a some advice. Yesterday I participated in a Speed Coding Competition with a friend (competition was based on teams of 2). We didn't win but that's not the important thing because we learnt a lot from this event and we became aware of our gaps. I noticed, one of my gaps was that I'm not able to fully focus whenever I'm under pressure. For instance, we obtained a question that I already tackled in class so it should have been easy for me to give a solution. But at that moment, my mind went completely blank. The thing is, may be this is because, there were some previous questions where we didn't attempt because we weren't able to understand the logic/what the question is trying to say (well I didn't understand, my friend understand it well; at first, he was like me, not understand how we need to work things out but then, when I see him, he was fully focus on the question, he notices every pattern, he came out with some logics, some didn't work and he still manage to work towards another logic which would now work. I couldn't do that, my mind has completely shut down 😭 ). IF I was at home, at ease, may be I would be able to understand the questions and came with solutions but here I couldn't.

So, I was wondering, if you guys can give me some advise on how to improve myself to work under pressure, how to keep a calm mind and think properly; the sensation of not being able to do anything is really disgusting... I don't want to have that again 😭 . This is not only to be better in competitions; tomorrow, I would have to work in industries, there I would need to THINK in place, come work solutions etc (I even noticed when I was doing internships, the truth is the majority of the work I was assigned to, I was doing them at home really, when my collegues were speaking, at some point when I don't understand anymore, my mind goes blank 🥲 ). Any advice that you guys can recommend is highly appreciated please.

#

The thing is, even when I try to listen to music and do my work, I can't do both at the same time, it seems that I can't dictate my focus to be solely on my work I'm assigned to 😭 that's a big problem

quasi scaffold
#

you should not rush to find the answer, calm yourself down and analyze, analyzing will give you the solution always

jolly night
next ginkgo
jolly night
#

Yes, that is important, but the time pressure is very different in the real world.

next ginkgo
jolly night
next ginkgo
#

ah I see, yep noted, thanks 👍

fair needle
#

hi

hollow cedar
#

i can tell that doing things fast comes from experience

and that experience itself doesn't need to be fast

fair bluff
#

Hello, this is my first "post" of my code, Idk, I wanted to share my code with others, since I finally finished the str methods.

royal dove
quick prairie
#

Hi can someone recommend a visualiser other than py tutorial one I am trying to understand data structures I used a module graphviz which chatgpt gave it is just an image of connections I need a step by step line by line visualization so I can understand what each piece of code does

#

I don't know where to post it is confusing

misty dirge
sonic dove
#

Does learning .marathon really work well?

jolly night
#

this doesn't seem to have anything to do with pedagogy

rain radish
#

Hi, this isn't the place to recruit.

obtuse hinge
#

What is pedagogy

misty dirge
misty dirge
obtuse hinge
#

Thx

thin saffron
thin saffron
#

like a head on a stake?

misty dirge
#

No

thin saffron
#

alright

coarse robin
#

is there any video explaining cpython object internals ?i am looking for it for a educational insttute
if you know a good one i would love it to be shared

weak mortar
#

there was this one talk about cpython memory structure

#

let me check maybe I can find it

misty dirge
weak mortar
#

but but they were asking about it to teach so...

misty dirge
#

Doesn't count; see the channel description.

weak mortar
#

cool py_guido

limpid lance
#

HELLO! new here. new to python, I am on a mission to learn Python, cybersecurity, and AI Theory and get certed in about 3 months, because I am laid off as a engineer for End user infrastructure support and think I may see the writting on the wall. Oh and in order to really really learn the coding i already forced myself to go back to ms dos to relearn command line, to get my head ready, I am coding a final fantasy 1/2 style rpg that incorporates learning cybersecurity. Oh and I set it all up in ubuntu, because that seems like the most ideal environment to learn and code it in and starting with VSCode, I am going through some free learning like w3, but looking into something like boot.dev as well. I believe that the partnership of learning and doing and seeing and failing/succeeding is probably the best way of learning. Wish me luck, nice to meet you all. And I will update on the progress as I troubleshoot and attempt to perfect my methods of learning and what environments work best, to maybe help others on their own journey's.

stone bear
quick prairie
pastel river
#

Reading the "A Philosophy On Software Design" and really like it. Anyone else read it? What opinions/recommendations do you think can be turned inte lint rules? It would be nice to have rules to push for some aspects of the book. Let's discuss! 🙂

misty dirge
pastel river
#

Yes maybe, thanks 👍

weak mortar
#

I am convinced no one knows what this channel is for

worldly dewBOT
#

:incoming_envelope: :ok_hand: applied timeout to @urban walrus until <t:1741735775:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

The <@&831776746206265384> have been alerted for review.

drowsy cloud
#

Hello! I've been meaning to ask any self taught programmers to share some tricks. I personally I plan a list of things to learn and then hit ai and read some books too but mostly ai is this way of learning really a good way for a self teaching yourself a program? like recently i was dealing with data structures in pyrhon

drowsy cloud
#

you're right am following cs229 and i enjoy it, but what advice would you give me as an obsessed noob who is curious to learn

tame dagger
coarse mist
unborn dome
#

Hi, I just learned python and I wanted to know if it's bad for my learning if I use an AI because for a small personal project I used a lot chatGPT and I understand everything that is marked on my code but I do not know if it's a good thing to use the ia especially that without it I do not think I would have succeeded in doing what I did.

#

I also noticed in my apprenticeship that I had big gaps in algorhythmy and so I found platforms like genepy to learn algo is it good?

misty dirge
unborn dome
misty dirge
knotty mesa
#

whats pedagogy?

thorn linden
thorn nova
#

can someone tell me how much time will it take to learn for this job position

Job Duties and Responsibilities:

Writing new services to collect and process data from external vendors and public APIs
Writing internal APIs to assist with the processing of card applications and their ongoing underwriting.
Integrating new research from the data team into our production processes.
Writing ad-hoc scripts in order to bulk-process historical data.
May be required to perform other tasks and duties reasonably related to job responsibilities.
Experience/Knowledge, Skills & Abilities:

Bachelor’s degree in a relevant field required, Graduate degree in relevant field a plus
Expertise working with one or more relational databases systems (e.g. SQL Server/Postgres).
Strong knowledge of Python
Data processing experience and analysis using Pandas/Numpy
Experience working with consumption of external REST/SOAP APIs
Experience in writing new APIs (preferably using Python/Flask)

#

I have experience with api's but not with flask and I have little experience with numpy and pandas

silent goblet
thorn nova
#

i read that and it's related to this channel because i need someone to tell me where to start and how much would it take to learn it by my self ? so this question is very similar to one example in pinned messages "- How important is it for a programmer to learn some amount of assembly?"

jolly night
thorn nova
#

ohh okay thank you for a very clear response

dense notch
#

Hi I'm new.

jolly night
solar schooner
#

Your going to download step-by-step videos setting up RESTFUL frameworks then start downloading github repos

#

It would usefull to understand what your ACTUALLY doing... your building systems for CLOUD architects

misty dirge
#

Only English is allowed in this server. Please remove your message and post it in English in an appropriate channel.

weak mortar
#

@worldly cobalt

fickle valley
#

hi

ember portal
#

I’m volunteering to teach some really young kids python and scratch, is there any easy way to explain more complex topics that are needed for the language?

hushed harness
#

Provide some simple examples(consist of only things they have learnt and only 1 new thing that they are going to learn) with annotation on the new concept, difficult to understand part?

native hearth
#

what kind of complex topics are you planning on teaching? i dont think kids need to know about decorators or metaclasses

ember portal
#

I guess like stdin stdout?

#

I’m sure they’ll eventually ask how the thing gets outputted

thorn linden
#

you can just say something like "every program has an input and an output" (don't say "standard <stream>", don't mention stderr, and don't use the abbreviations stdin/stdout unless they come up naturally somewhere)

silent goblet
#

(and how much time do you have?)

ember portal
#

It’s most likely replit though

silent goblet
#

oh, they already know some Python?

ember portal
silent goblet
#

note that replit now requires an account... I think

ember portal
stark lichen
#

Hello everyone! I work with data and I’d like to start learning Python. I’ve seen a lot of videos on YouTube, but I’m not sure how to start. I’m kind of a tinkerer — I don’t have a huge IT background, but I can handle some Linux command line. Do you have any good resources or advice to get started?

rich mural
worldly dewBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

true hull
#

.

misty dirge
#

Hello, please remove your message from this channel and paste it in #editors-ides

weak mortar
#

What is this channel?

#

Ah ic is there a good way to get my freind to learn how to use python it's been 4 years and he's still struggling to use print 😭

#

Not sayinging he's a low intelligence specimen but with the ideas he comes up with he really needs to learn

stone bear
#

The best tends to be the latest and greatest, which Google should know. Google definitely knows the most popular, which could be the best to some. But mrhttp should be of interest to a high school student who should know how to google. It's a Python lib written in C, though, which with the popularity of Rust might not be the best cross-platform language anymore if by best you mean performant.

vernal skiff
#

Hello, I recently started a club for informatics in high school and thankfully a lot of fellow students joined. Most of the members who just joined aren't familiar with any programming language, some understand computational logic while some are building up from 0. Now i want to teach them python since that's honestly the only language I'm confident in teaching but in cases like this is it better for me to straight up teach them python so that they can perhaps learn computer logics and simultaneously learn a language or should i teach them logic first like explain what is stuff like If and Loop are FIRST without teaching the syntaxing and stuff?

misty dirge
vernal skiff
#

Woah, this is really helpful. Thanks!

rich mural
#

Like, you can explain what an if statement is, but it'll be much easier to really grok it if you can then show an if statement in action on the computer.

weak mortar
#

I use glow charts sometimes and it seems to help in both directions (showing them code I've created in a glow chart format and them constructing there own code using flow charts to show they understand the basic logic behind it)

vernal skiff
trim cove
ember portal
halcyon mauve
#

As a teenager, what should and shouldn't I include in my CV?

rich mural
halcyon mauve
obtuse garden
#

Python... first of all is very powerful.. for example winetricks ... can make a windows instance in linux and runs lightning fast..

#

Winetricks, lutris in linux jellyfish 22.04 for example... written in python will make you appreciate the speed python operates at... it will blow your mind ..

#

Neither of you guys fully understand the power of python and how crazy fast wine trix allows you to deploy a version of windows 7 for example.. download any launcher like steam for example and play a video game ... for example if your into that

trim cove
atomic mesa
#

What is pedagogy?

rich mural
atomic mesa
#

Oh, can I fit 5 courses in my brain within a year?

rich mural
#

Depends on you and the courses, I guess

#

But I took more than 5 courses per year at uni, and that generally worked out

ember portal
coarse spear
#

Can I create a calculator like this?

 numerical_expression = input('Type your numerical expression: '

result = eval(numerical_expression)

print('The result is: ',  result)
#

the question can be asked and answered in the console

coarse spear
#

In pycharm

#

yes, it works

rich mural
#

This channel is for discussions about the methods and practices of teaching, and especially teaching Python

coarse spear
#

oh, sorry

rich mural
coarse spear
#

ok

silent goblet
#

Every language defines modulo with negatives in a different way. I have to look it up every time I care about the behaviour

#

(for example, in JavaScript and C 9 % -10 is 9)

#

I don't know, depends on the context

#

It's probably more important to teach the skills to find the answer to this question when they need it

rich mural
#

I don't think the problem in itself is important. If I ran into something like this in practice, I'd be like "huh", then google it and find the answer.

silent goblet
#

You might ask that as a research exercise, like: "what happens when either a or b are negative in a % b?"

rich mural
#

I've had a lot of similar situations with floating point arithmetics.

rich mural
#

It's funny how helping someone is easier the more experienced the student is, even though the problems they have are generally inherently harder. Complete novices in particular are notoriously difficult to teach because they often face fundamental hurdles in reasoning about code.

misty dirge
rich mural
#
import tkinter as tk
import datetime
primary = tk.Tk()
primary.geometry('2320x1080')
primary.title('clock')
while True:
    x = tk.Label(primary,text=str(datetime.datetime.now()),font=('SEC Medium_SamsungKoreanM Medium', 28))
    x.pack()
    primary.mainloop()

they couldn't fathom why datetime.datetime.now() wouldn't continuously update its value, even after it was explained that mainloop() is blocking, and it became quite the struggle to try to figure out in what way they were confused exactly

#

With a complete novice, the issue is generally identifying where the gaps in knowledge are, or in what way they've misunderstood some basic concept, and the difficulty is compounded by the fact that the novice themselves lacks the language to express what they don't understand.

#

You have to ask questions and try to piece together what their state of mind is from vague indirect clues.

rich mural
#

In some sense, I guess. Though when I hear the word "automation", I tend to think of some currently manual process being automated. This isn't really something anyone would do by hand.

rich mural
#

!rule 9

worldly dewBOT
#

9. Do not offer or ask for paid work of any kind.

silent goblet
#

It's extremely niche and completely non-essential

#

you could argue it's harmful to teach it, since students will try to use it inappropriately (kinda like eval/exec)

misty dirge
#

I don't think it's essential. If anything, I fear novices would use it to create variables dynamically

#

Is there a reason you asked about locals and not globals?

silent goblet
#

||yet another builtin that's supposed to be in sys or inspect instead||

misty dirge
#

Locals isn't a keyword

#

That's better than using locals and globals, I guess

However, I would encourage their curiosity, as long as they come away knowing how to metaprogram responsibly

steady grail
misty dirge
steady grail
#

why is that? Does not Pedagogy refer to "teaching and sharing information"? @misty dirge 😄

misty dirge
next ginkgo
#

Hello guys, I have a quick question. When we learn something, say I want to learn linear algebra, the best way to learn is to get started. Now the thing is, say I'm reading a book on linear algebra, in college/universities, normally, we don't cover an entire book, no? Like, on part of the contents? So my question is if I have to do some self-study for whatever topics, how should I proceed? Because I quickly feel overwhelmed on the long run when I see all of the contents to be read

rich mural
#

In some cases, there are also online learning platforms with some kind of topic progression tree that'll give you a sense for in what order to tackle subjects and how much of a subject you've covered.

thorn linden
next ginkgo
#

Yep I see, thanks !

dim sail
#

I really wonder why this isn't taught as much. It's one of the most basic ideas that gets pushed down on students who learn C/C++. Maybe it can be argued not to be that clean to write.

rich mural
#

Maybe it sees more usage in C due to lack of exceptions.

dim sail
#

You're right about that

#

by basic I meant it's in one of the earliest pages of the C tutorial book by K&R - not necessarily how basic it is as a practice or concept

#

but yeah the first use that came to my mind is exceptionless error checking

rich mural
#

Well, for a language like Python, it makes sense to teach language features in order of importance and frequency of use

#

The K&R C book may not be the best representation of pedagogy in programming education

#

I'm not sure how good it actually is, but since it's so old, we've probably made a lot of progress in programming pedagogy since it was written.

dim sail
# rich mural Well, for a language like Python, it makes sense to teach language features in o...

I'm seeing that a lot here and I'm constantly at odds with it but I absolutely love it
I kinda have a bad taste in my mouth from my undergrad courses which are made by really old folk (some of whom still think UML is the future of java GUI programming), but they're really the only reference point I have on how programming teaching is done so I'm glad I'm getting exposed to other approaches

rich mural
#

Which I took about 16-17 years ago

dim sail
#

Well I doubt it's going to get any better for me except in the more theoretical courses (DSA and OS, Computer Organization where there hasn't been any drastic progress done)

#

But I have a few family members who'd like me to teach them programming which is proving to be insanely hard and I've only started preparing the material

distant pagoda
#

Hello guys i have a quick question . I'm a student in civil engineering now in our we learn python for example to do calculation of wind load , beam etc. Now my question is to now the order use of python bcs i want in-depth in the language .

fervent flint
regal mantle
#

hii, someone here speaks spanish and wants to learn about math and physics?

worldly dewBOT
#

7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.

stiff crystal
earnest meteor
worldly dewBOT
#

:incoming_envelope: :ok_hand: applied warning to @stiff crystal.

stiff crystal
earnest meteor
worldly dewBOT
#

:incoming_envelope: :ok_hand: applied timeout to @stiff crystal until <t:1745736281:f> (7 days).

white pine
#

ooh nah jit tripping blud got muted

winged geode
stiff crystal
stone bear
ruby ledge
#

Would you use this over unit-testing

stone bear
#

Unit testing is more important than visual programming, but peda refers to children who prefer something fun to look at over boring text.

misty dirge
stone bear
rich mural
stone bear
#

here's a video on the concept, called "flow based programming": https://www.youtube.com/watch?v=wlna48I2aIE

Flow Based Programming is a type of visual programming where you connect the inputs and outputs of various functional nodes.

I wrote a Javascript API to create (visually questionable) flow charts, and proceed to make a very unintuitive programming language based off of it.

This project is open source, under the MIT License. The GitHub reposito...

▶ Play video
worldly dewBOT
#

:incoming_envelope: :ok_hand: applied timeout to @solemn swallow until <t:1747230982:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

The <@&831776746206265384> have been alerted for review.

heavy pond
#

Need help understanding the Python Data Model? check out: https://youtu.be/pvIJgHCaXhU

🔗 Links:

📌 Topics in this video:
0:00 Intro
0:06 Immutable and Mutable types
4:02 Copy
6:41 Custom Copy
9:10 Function Calls
11:16 memory_graph Debugger Setup
13:34 memory_graph...

▶ Play video
heavy pond
#

Different ways to "copy" a nested list, and much more of that stuff

heavy pond
copper cosmos
#

If you're at pyconUS and want to learn about team programming,
I'm hosting an open space for Ensemble Coding. Friday at 6pm in room 309.

signal adder
#

If any of the experts here decide to make a book, dont use your own custom libraries. Theyre fucking useless and teach you nothing. If you want to understand what Im talking about, read the Introduction to Statistical Learning Python book. The way it teaches the theory is really good as it explains complex topics in a much simpler way. The programming aspect is dogshit due to their constant use of their custom libraries and lack of an in depth explanation of each tool. Teach beginners like me how to use the libraries, that the industry uses, from the beginning and explain what each part does. For me to effectively start making my own projects, I need at least a decent base understanding of what the tools or else itll just be hours searching the internet and only coding for a few minutes

silent goblet
#

That can have huge benefits, because you can leave out everything that the learner does not need to learn the concepts.

#

For example, industry tools typically value backwards compatibility. If you want to teach someone Python, you will need to teach the quirks as well: bool being a subclass of int, += doing mutation on collections, mutable default arguments, late-binding of closures, if expressions having an unusual order, stdlib names not following PEP8 etc.

#

Of course, if the book advertises as teaching the things used in industry, but instead teaches Scratch, that's a different situation

#

and if you explain the tools poorly, well, explaining industry tools poorly is not good either

signal adder
#

Thats the issue Ive faced with ISLP. It doesnt thoroughly explain how their custom libraries work. It doesnt matter now. Ive decided ill use ISLP purely for the maths and Ill use other resources on the internet to teach myself how to use the ML libraries

misty dirge
#

!warn 1340035829891862650 your previous message in this channel was not appropriate. Please read the #code-of-conduct

worldly dewBOT
#

failmail :ok_hand: applied warning to @karmic wyvern.

obtuse hinge
oak galleon
#

random question: can a fonction return a fonction as an output?

misty dirge
oak galleon
#

ok

solemn ledge
heavy pond
#

memory_graph in PyCharm debugger

shell aurora
#

When is a good point to teach people about virtual environments. And before that should you just give them step by step instructions on how to use a virtual environment or should you just not have them use a virtual environment?

misty dirge
#

or if pycharm forces them to learn about them right away

rich mural
#

I wouldn't go out of my way to explain them unless they ran into a problem caused by not using a venv, or if they explicitly ask about them.

shell aurora
#

👍

rapid sluice
#

hello, I have a doubt and I would like a recommendation. I am a self-taught and want to learn data analytics and artificial intelligence with python which is the best course on the internet? that can be classified with these characteristics: -certificate -beginner to advanced -online and virtual -which guarantees you work or has international educational weight
I hope your answer would appreciate it very

thorn cargo
#

ive liked dataquest.io but you have to pay as it is an extensive online library of useful courses

misty dirge
#

hello, your question is not on-topic for this channel. Please remove it and paste it in a new thread in #1035199133436354600

misty dirge
#

Hello @modest spruce , your message is off topic for this channel. Please remove it from here and paste it in a new help thread in #1035199133436354600

grand shadow
#

Hi guys, what stack should I learn for developing own AI, and what steps should I take first, I know python a bit, but guess it wouldnt help a lot

rich mural
misty dirge
swift path
#

I'm wondering if I should teach types.SimpleNamespace first to my friend or classes. What do you guys think?

silent goblet
swift path
rich mural
#

I don't think there needs to be an intermediate step between dictionaries and classes.

misty dirge
swift path
#

Well, class objects are pretty similar to dicts, too, but they have more features

rich mural
#

NamedTuple would be a better 'analogy' for classes, yeah, since you define a template that you instantiate

misty dirge
#

right. but namespaces have fewer features than dicts.

swift path
#

Oh yeah that's definitely true

#

Thanks for the NamedTuple suggestion!

misty dirge
rich mural
misty dirge
silent goblet
silk wraith
# swift path I'm wondering if I should teach `types.SimpleNamespace` first to my friend or cl...

I would teach dicts and work up to classes/objects like so:

  • basics of a dict: they associate a key to a value
  • dicts are sometimes taught as a way to have dynamic variables, I really dislike that, I would teach it as a way to group related data together (see where I'm going?). For example, make a dict to represent a user with a name, email address, etc
  • write several functions that accept a user dict and do something with it (send an email, greet the user, etc.). Doesn't have to be "real", just convey the idea.
  • highlight that this can be risky because it relies on the dict having a specific set of keys. To overcome that, you can work through adding two things:
    * a function that accepts all the values a user dict needs, and creates and returns the dict (this makes sure the keys are normalized)
    * input checking in the functions that use the user dict (validate that a key exists before get'ing it, etc)

After that exercise, you have a really good lead in to "So, dicts are a nice, dynamic way to group related data. Wouldn't it be nice though if we could also bundle this functionality (the functions we wrote) with the data so that it was all one package?"

That's how you introduce classes:

  • They bundle related data together like a dict (via attributes)
  • They provide a way to normalize "state" like your user dict creation function via the init
  • They let you keep functionality related to that state close to that state, and you don't have to check that the state exists like you did with the functions that just accepted a user dict
swift path
#

Hey, thanks for your response, but I've got a couple questions

#

First of all, you say this:

dicts are sometimes taught as a way to have dynamic variables
What do you mean by "dynamic variables"?

silk wraith
#

as in, you don't know what variables you'll need ahead of time, or what their contents will be

#

it's not wrong, I just think it poorly expresses what a dict is good for/does

swift path
#

What you're saying is a pretty good idea, but in my opinion (which could be wrong) dicts are probably better thought of as not much more than key-value stores rather than "an underpowered version of objects" whereas objects represent entities or concepts.

I understand, though, that your example is exactly hinting at that; that dicts aren't the right tool for that kind of job (e.g. storing information about a user), but I don't want to create the impression that user-defined objects are just more powerful dicts

silk wraith
#

well...they are though

#

I mean, it's not always a useful way to think about them, but they actually are. it's just that there's quite a bit of powerful "stuff" built on them

swift path
#

The usage of dict does usually hint at some sort of dynamism going on. For example, a recursive listing of a directory would likely be represented by dicts:

{
    ".": ["file01", "file02", "file03"],
    "folder1": ["file11", "file12", "file13"],
    "folder2": ["file21", "file22", "file23"]
}
silk wraith
#

and you can absolutely do domain modeling with dicts/maps/etc. plenty of languages do that extensively (like lisps)

swift path
#

My point is that you're not supposed to think of them in that light to use them efficiently

silk wraith
#

not supposed to think of what like that, classes/objects?

neon pasture
#

it's also not really true, int doesn't store its attributes in a dict, nor do classes with __slots__ (tho they will compute a dict for you if you ask).

silent goblet
#

I haven't tested this, but I think it's a good idea to teach classes through the lens of behaviour (and polymorphism). Classes aren't just used to bundle data, you can use a dict for that

swift path
#

What else is there other than data and invariants?

#

While interacting with the class over methods and properties does prevent certain undesirable states within the object, it's just about establishing invariants and handling internal events within it

silent goblet
#

I think it's very hard to come up with useful examples of classes

silk wraith
#

I would imagine it would be quite hard to grasp polymorphism without a pretty firm understanding of classes/objects and method dispatch. not sure how you centralize that concept

swift path
#

I was forced to learn them when starting to use Tkinter 😅 (It was impractical otherwise)

#

I also remember using classes (when I didn't understand them well and avoided them) to make a resettable TicTacToe object and conveniently interact with the gameboard

silent goblet
# silk wraith I would imagine it would be quite hard to grasp polymorphism without a pretty fi...

You can achieve polymorphism in other ways:

def _rectangle_area(rect):
    return rect["width"] * rect["height"]

def _rectangle_scale(rect, n):
    rect["width"] *= n
    rect["height"] *= n

def _rectangle_info(rect):
    return "make_rectangle({0[width]!r}, {0[height]!r})".format(rect)

def make_rectangle(width, height):
    return {
        "width": width,
        "height": height,
        "area": _rectangle_area,
        "scale": _rectangle_scale,
        "info": _rectangle_info,
    }
#

but if you arm a beginner with this knowledge, it's going to be hard to explain why classes are typically used for that 😄

silk wraith
#

they'd right some real fun code though

swift path
silk wraith
#

I took a graphic programming class in C way back when, and decided I'd be clever and implement something akin to objects. I caught my professor reading over some of my code and muttering jesus christ once.

swift path
#

But that's just a speculation 😅

silent goblet
#

I think reflecting on why is kinda important. It'd be reasonable to write this kind of code in JavaScript, probably. But not in Python

swift path
silent goblet
#

Implementing objects in C is pretty common. CPython definitely does this

silk wraith
#

well yeah, but they do it well. I'm sure I did not

swift path
#

In a cursed way...

silk wraith
#

I did make some pretty raytraced spheres though, so all's well that ends well

silent goblet
#

You start modelling something as a tuple or a dict, then you add a bunch of ifs, and then you add a function as a member, and then you introduce classes and gloss over as to why you use classes for this (something like "it's more reliable and not as messy")

swift path
#

I did something like this: (formatted code tightly to not flood)

#include <stdio.h>
typedef struct Person
    { const char* name; int age; void (*introduce_self)(); }
Person;

Person make_Person(const char* name, int age) {
    Person self;
    self.name = name; self.age = age;
    void introduce_self()
        { printf("Hello, world! I'm %s and I'm %d.\n", self.name, self.age); }
    self.introduce_self = introduce_self;
    return self;
}

int main() {
    Person person = make_Person("Tigran", 17);
    person.introduce_self();
    return 0;
}
#

I know this is not standard C

#

Don't throw stones at me I was just mucking around :(

swift path
#

And even in the basic cases essentially what classes do is streamline that process anyway

silent goblet
#

I think the real good reasons for using a class are:

  • classfication (you can see the type of an object and see what it is and where it comes from)
  • inheritance
  • nicer syntax (foo.bar and foo.baz() is just how you're supposed to access known fields/functions of a thing in Python)
  • dunder methods (in particular __repr__ and __eq__)
swift path
#

repr is amazing. I wish more languages had something as simple

silent goblet
#

the idea I'm trying to get at is, unlike many other concepts, classes don't really introduce something you weren't able to do before

swift path
#

Because Python doesn't do the cursed data hiding nonsense that other OOP languages do

silent goblet
swift path
#

I think of Python classes as copyable and instantiable namespaces

#

That kind of model really helps because you can add your own attributes to instances (not that you should, but still)

tawdry oak
#

I also like to think of classes as a convenient way to share variables easily between sets of functions without flooding them globally

stone bear
swift path
#

If I recall correctly, C++'s output streams (std::ostream) have a global state when you print formatted output. The new text formatting library (C++20's std::format, C++23's std::print) is better because its state isn't global.

C++17:

std::cout << std::hex << 0xDEADBEEF << '\n'; // prints "deadbeef"
std::cout << 255 << '\n'; // prints "ff"

C++20:

std::cout << std::format("{:x}", 0xDEADBEEF) << '\n'; // prints "deadbeef"
std::cout << std::format("{}", 255) << '\n'; // prints "255"

C++23 even lets you do std::println("{}", obj)

#

I'm really not a fan of C++ though, so much technical debt :/

stone bear
#

For real. At least it's clear about which the best version and execution order are, unlike Lisp.

swift path
#

Execution order? What do you mean?

stone bear
#

Lisp uses Polish notation, which is fine for machines, but humans prefer infix notation

swift path
#

Ohh

#

Well, Polish notation is easier to implement, but how is it any better for the machine other than that?

stone bear
#

A small implementation (one page iirc) is easy to debug, optimize, and run, but hard to use without building your own framework first, hence the many versions of Lisp.

swift path
#

Ohh I get what you're saying. Well, the complexity eventually ends up accumulating somewhere. A language with a complex specification is better than a simple language that's a nightmare to use. 😅

stone bear
#

Python is a good balance, but somehow not as performant as Lua or Julia, which i dislike for their optional zero-based indexing.

swift path
#

I think if Python had stronger typing it could very well be a neatly-performing compiled language

#

Though we'd lose eval, exec and all those sorts of things, so it'd be a subset of Python

stone bear
#

Sounds like RPython, part of Stackless Python which runs EVE Online. My current favorite programming languages are Mojo, V, and Nim, but those aren't mature yet and i should check out Kotlin some more.

#

oh, and Bend should rival Mojo

misty dirge
#

This isn't a language discussion channel--be sure that everything pertains to how to teach programming.

#

Otherwise, please move this to one of the three off-topic channels.

misty dirge
#

@elfin violet your message is off-topic for this channel. Please cut and paste it to one of the three off-topic channels.

stuck mist
misty finch
# stuck mist https://github.com/ivuqarism/password-gen

Hello, here is my password generator with python too just like you, but it is a video the video link is here: https://www.youtube.com/watch?v=RugxgN--pwM&t=5s

​@ProgrammerRobot

I have added a webcam in this video🥰.

In this video, we will make a password generator using python.

You can Generate your own password form this project

If you have any ideas what to do write it in the comment.
I hope you enjoy it🥰!

Thanks For Watching!
Bye👋!

Chapters:
00:00 Introduction
00:10 Importing rando...

▶ Play video
#

https://www.youtube.com/watch?v=RugxgN--pwM&t=5s This is a password generator you can also check!

​@ProgrammerRobot

I have added a webcam in this video🥰.

In this video, we will make a password generator using python.

You can Generate your own password form this project

If you have any ideas what to do write it in the comment.
I hope you enjoy it🥰!

Thanks For Watching!
Bye👋!

Chapters:
00:00 Introduction
00:10 Importing rando...

▶ Play video
royal dove
#

@misty finch @stuck mist this is not the right channel for this. You can either talk about this in #python-discussion or one of the 3 off topic channels 😃

misty finch
forest belfry
#

pass gen tool is sweet little project! But yeah, wrong chat haha

flint ibex
#

Don't spam this (or anything else) across channels

torpid spindle
#

Hi

brittle urchin
#

Yo

clever spear
#

I also have plans for objects as I say, Im just going to quickly map the function syntax over

worldly dewBOT
clever spear
#

I think this would nicely fit a way of teaching/explaining a class

signal adder
#

How should I go about teaching my sisters how to code? In all honesty, evne though I’ve been programming for nearly 2 years, its been very on and off due to my own uncertainty in wtf I want to do in my life. Regardless, I still want to teach my sisters

#

Btw theyre both 9 years old. Tbf, the younger of the twins is more interested as she told me she wants to learn to code but I told her tomorrow. Just not feeling great today

coarse quest
# signal adder How should I go about teaching my sisters how to code? In all honesty, evne thou...

"hour of code" is a fun visual thing to introduce children to simple coding.
https://hourofcode.com/
And a lot of tasks are translated into many languages.
Tasks are divided into levels by grades, but there's a lot of them to explore depending on what visuals appeal to you - Disney stuff, Minecraft, Star Wars, Barbie...
... OMG, I just browsed and found some tasks have "pre-reader" as level. 😱😍 That means I could try to get my 5yo nibling to try "coding"!

Code.org

The Hour of Code is a worldwide movement that aims to introduce millions of students to computer science through one-hour coding activities

signal adder
coarse quest
# signal adder Thank you pal. In hoping it ignites the coding bug in them

Some tasks are about drawing with moving character (Frozen for sure, but with arches/circles - I remember specifically because it released when I was in high school and our cs teacher made us play it to proofread the translation), so they might be followed by turtle module later :3

Although in over a decade since I last really checked the games there (as I said, hs teacher made us, lol), it grew quite a lot, so there's a lot to explore in there anyways.
As the name says, the task chains are designed to take around an hour to do, so maybe try to do one a week? Quality time with siblings connected with teaching. :3

signal adder
#

Ill try that. Ngl Im ashamed my coding skills are still not up to par after 2 years but then again, I’ve been doing on and off. Still got a few simple projects. If I get some money, Ill start doing some embedded projects and get them involved. I know I can use online simulators but personally, that does not compare to actually building things with your very hands

#

Forgot I had a circuit playground express mc. I might use that with my sisters

gusty cosmos
#

Question! I’m a college student utterly new to coding. What do you do with Python???

misty dirge
heavy pond
#

A Data Structure like a Binary Tree is easier understood and debugged with data visualization using memory_graph: https://pypi.org/project/memory-graph/

polar wolf
#

hey

sand cobalt
hallow verge
#

Just wanted to share (don't know if is the right place), i've been strugling with learning how to manipulate json and this site really helps u understand it
https://jsonpathfinder.com

wide lantern
# clever spear For those who likely dont want to download:

wao natural language program! I'm reminded of the domain specific language Inform 7, for interactive fiction.

I find it actually pretty terrible for newcomers, so maybe don't take too much of an inspiration from it, but as a cool party trick, this is a valid statement: "Instead of a suspicious person (called the suspect) burning something which is evidence against the suspect when the number of people in the location is at least two, try the suspect going a random valid direction."

also, https://www.plover.net/~pscion/Inform 7 for Programmers.pdf

untold island
misty dirge
#

This channel is for talking about techniques for teaching python and other concepts. Please make sure every message in this channel is about that.

clever spear
#

Its also kinda why im targeting python, a simple teaching language, to an easy use language. its to develop initial programming skills

hallow verge
# untold island Have you worked when XMLpath syntax? it's, at least for me, very unintuitive. wo...

I'm still learning quite a bit about Python and those Markup languages. I haven't had the chance to use XMLPath yet — it does sound more intuitive to me because of the way it's structured, but I haven't tried it.
I used JSON, not even by choice 😅 — I needed to grab a JSON coming from a JavaScript program from a friend and manipulate it with Python.
I do intend to try YAML in the future, since it seems very easy to use.

hallow verge
misty dirge
#

seems like the discussion about XMLpath and JSON isn't about how to teach programming.

pine stratus
untold island
#

python >= 3.11 has a built in tomllob, which is nice

#

but not sure why it's not just called to toml

misty dirge
#

Please go to a different channel to talk about json, toml, etc.

untold island
#

I'm happy to end the discussion here

#

but I do have a very relevant pedagogy related topic that @jolly night witnessed last night/this morning on general

#

someone wanted very insistently to "learn python" so they could make AI stuff but they refused to read any resources

#

I doubt they've ever coded before

misty dirge
untold island
#

I wanted very badly to say "you have the wrong attitude for that goal"

#

you can't become an astronaut by watching space expeditions

misty dirge
untold island
#

I even mentione learnpthon.org, which is full of interactive code actors l snippets to experiment in.. I think they lacked a requisite curiosity

untold island
pine stratus
livid pebble
#

What's this channel all about? 🤔

silent goblet
signal adder
#

Are there any good kid friendly guides to python? Particularly guides to help kids learn programming through gaming? Im doing a guided project (tetris with pygame) with my two sisters just to pique my sisters interest. Well try to finish it today and then later on in the week try to see what psrts of the game we can change

frail junco
#

What is turtle? A book?

misty dirge
frail junco
#

Nice

cold dust
#

I want to know if you can draw animals in python using turtle cuz I am very new

severe hollow
#

🫡

near quail
#

For future reference, if I created an educational video, would it be okay to share the link here to request feedback?

misty dirge
#

Anyway,

Now that we're a few years into the ChatGPT era, does anyone know someone who used ChatGPT as a beginner to their detriment, and when it became clear that they were lacking skills, and how they overcame?

hoary cipher
misty dirge
hoary cipher
misty dirge
#

Hello, please read the description of this channel.

stone bear
#

Knowing the basics can be useful, but the bit flip treshold of the average RAM might be too much for people who don't care that much about integrity

stone bear
#

Not to mention the ethics of hardware and software sourcing

vague tartan
#

hello am new here, and i want to start learning

#

where do i start from

stone bear
onyx salmon
#

^

distant stratus
#

Hey guys I'm going to start a server on discord about phenomenology, I will be using obsidian to do allot of the designs which uses allot of CSS so any advice is appreciated

burnt pilot
#

How old should a student be to start learning programming? Is 8 too young?

winter spear
#

People learn subjects at battle different ages. If they're interested in it and comprehending it doesn't matter

sacred notch
elfin violet
#

def φ(x=1): return x, φ

tulip narwhal
golden crescent
rose lantern
#

Programming is hella hard at first but sooner or later it just becomes patterns

#

Plus I don’t think everyone’s going to know everything off the top of their head so simply asking for help is very important with coding

#

As long as they understand it and are willing to keep trying then that’s it

crisp lion
misty dirge
#

I actually think [teaching range-len instead of zip is] what should be taught to beginners
@cyan spindle explain

cyan spindle
#

It's like, the bread-and-butter of many languages out there. I don't think you can say it's "bad".

#

do stuff by indexing manually into arrays.

#

Sure it might be less efficient in Python what with Python loops and all.

misty dirge
tepid berry
#

it's just that python has better ready made solutions as part of the core language (as part of the built-in functions to be more specific)

civic stag
#

I think it also matters what you're actually teaching. If you want to teach the low level stuff, then sure, range(len(list)) is better, but then maybe just go ahead ant teach C instead of python

cyan spindle
#

I still think it is much more of a natural building block when you learn loops.

civic stag
#

it's not natural in python at all. Python isn't a low level language, range(len( looks unnecessarily awkward

rain plume
#

why is range/len competing here with zip instead of enumerate

cyan spindle
misty dirge
#

I'm not really interested in this from an aesthetics perspective. if someone needs to iterate over two sequences concurrently, what about range-len gives the student a deeper understanding of programming than zip?

tepid berry
#

zip() is the "obvious" choice for the problem we are discussing where there are two equal length strings that you should print vertically beside each other

cyan spindle
#

Maybe I prefer to teach people "how to do programming" rather than simply "how to Python".

civic stag
civic stag
tepid berry
cyan spindle
#

I'm aware. My point still stands that whether you like it or not, sometimes you still need the range

#

^ reply to @civic stag

civic stag
cyan spindle
#

And to me, "zip" is a pretty advanced concept.

misty dirge
cyan spindle
#

It's not C-style looping.

silent goblet
#

I think it's a perfectly fine exercise. The purpose is to demonstrate indexing with a dynamic value, not to teach concurrent iteration over two collections

civic stag
#

but why do you consider it the default?

misty dirge
#

By "c style looping" I mean "a loop that increments an index as the means of accessing sequential elements"

cyan spindle
#

I don't even have C in mind.... It's just how any algorithm proceeds.
If you read pseudocode, it all reads FOR I = [0 ... N] or some such.

misty dirge
cyan spindle
#

And I think there's value in teaching the student to think atomically in such a manner. As I was saying, "zip" is a pretty advanced concept, from the functional realm.

#

"Ok I'll go to the 0th index, do this. Go to the 1st, do this. Etc...". I prefer students to learn this when they begin.

civic stag
#

why is functional inherently more advanced than low level coding?

cyan spindle
#
  1. I didn't say functional is more advanced.
  2. I don't think indexing is low-level.
    I said I think "zip" is advanced. Does anyone not think so?
civic stag
#

I think zip is a pretty simple concept

fleet garnet
#

is it fair to say that looping is more general and therefore would be more useful in a wider variety of similar problems

misty dirge
#

I don't think it's that advanced. though the reason I said "range-len is bad and zip is good" is because I always caveat when I'm going to guide someone through an unpythonic solution.

misty dirge
cyan spindle
misty dirge
#

!zip

worldly dewBOT
#
The `zip` function

The zip function allows you to iterate through multiple iterables simultaneously. It joins the iterables together, almost like a zipper, so that each new element is a tuple with one element from each iterable.

letters = 'abc'
numbers = [1, 2, 3]
# list(zip(letters, numbers)) --> [('a', 1), ('b', 2), ('c', 3)]
for letter, number in zip(letters, numbers):
    print(letter, number)

The zip() iterator is exhausted after the length of the shortest iterable is exceeded. If you would like to retain the other values, consider using itertools.zip_longest.

For more information on zip, please refer to the official documentation.

misty dirge
#

hmm, this could be improved.

#

but I think just observing the behavior of zip makes it self-explanatory.

silent goblet
#

If you want to explain what zip actually is, you probably need to explain iterables and iterators first, which is a long time away from hello world

#

But it's probably fine to say "just memorize this construct to iterate over two things simultaneously"

civic stag
cyan spindle
#

("It's more pythonic" is not an acceptable answer.)

civic stag
#

sometimes you can't do len(x) and zip is more readable

silent goblet
#

it doesn't require an extra counter variable

misty dirge
cyan spindle
#

And everyone in this discussion thinks zip is beginner-level-suitable?

misty dirge
#

yeah, I don't think it's that complicated or confusing.
people are smart and can intuitively understand what something does when they observe it.

#

I do think your point about range-len being more "atomic" is interesting, though.

silent goblet
#

I do think you can run into things like: py x = zip(foos, bars) and then being confused about the output of x or why iterating over x twice fails.

civic stag
#

Here's where my thinking comes from. How do we even get to parallel looping over two sequences? We get there from simple for loops. And which of these two examples looks simpler?

str1 = "Hello"
for x in str1:
    print(x)

for i in range(len(str1)):
    print(str1[i])
silent goblet
misty dirge
#
for x in str1:
    print(x)

for y in str2:
    print(y)

for x, y in zip(str1, str2):
    print(x, y)

these follow pretty naturally.

#

more naturally than replacing the whole looping machinery with range-len

cyan spindle
# silent goblet What's not beginner-level-suitable about `zip` in your opinion?
  1. From my experience teaching students (granted I have not had many), none of them found it straightforward to pick up. Even those that "got it" quickly did not realize in later situations that they could use it.
  2. It requires that they know unpacking.
  3. For those who transition from another language, it's a new thing and less natural than manual indexing.
silent goblet
#

ah right, unpacking

misty dirge
#

It requires that they know unpacking.
I don't think so. you can just see "oh, looping with zip gives me more than one loop variable" without understanding what unpacking is in general.

#

just like you can use range-len without understanding __iter__ and __next__

civic stag
#

maybe it would be more natural to teach single thing - fixed number of multiple things (tuples, packing, unpacking, maybe even structs) - variable number of multiple things (arrays)

cyan spindle
#

But still, my #1 reason for preferring to teach manual indexing, is that that's the way the algos go. Personally I'd rather let the student discover zip on their own. It's like syntactic sugar you never knew you missed.

fleet garnet
cyan spindle
#

They didn't reply, so nobody knows 😛

misty dirge
fleet garnet
#

person in the thread. giving them zip feels like handing them a black box. which i guess is fine.

misty dirge
#

everything in programming involves abstraction

fleet garnet
#

i'm quite new myself and honestly being handed a zip object is confusing, too. like what do i do with this now

civic stag
#

iirc they've received help before so probably whoever helped them before would know best 😇

fleet garnet
#

do i unzip it lol

#

printing it doesn't work. hmm

cyan spindle
#

well do you at least know what it does now?

fleet garnet
#

oh i can make it a list... doesn't really solve it

cyan spindle
#

it's matrix transposition, essentially.

misty dirge
cyan spindle
#

I wrote that precisely to tell you that it's not an easy idea!

civic stag
#

but it's not "essentially matrix transposition", it's "take one from this then one from this"

fleet garnet
cyan spindle
#

You're probably just very used to it. I am too. But we have to see from the eyes of a beginner.

misty dirge
#
for x in str1:
    print(x)

for y in str2:
    print(y)

for x, y in zip(str1, str2):
    print(x, y)

# vs

for i in range(len(str1)):
    print(str1[i], str2[i])

I'm even more convinced than when I entered this discussion that zip offers a more natural learning curve.

cyan spindle
misty dirge
#

so is range-len

silent goblet
cyan spindle
#

Well range-len requires the sequence to already pretty much be in memory.

cyan spindle
silent goblet
#

"It will be explained later when we learn about iterators and iterables"

misty dirge
#

they don't even necessarily need to know that zip is a type of object, any moreso than they need to understand how range works except how it behaves when it's in a for statement.

cyan spindle
#

That is a good point.

misty dirge
#

"range lets me loop over sequential numbers"
"zip lets me loop over more than one thing in the same loop"
neither of these require that you understand the implementations of zip and range, or their behavior in any other context.

silent goblet
#

I've seen people (here) surprised that range isn't a generator function or that zip is a class (and not a function) after years of successfully programming in Python. So I think it's fine to have some suspension of disbelief in language idioms

misty dirge
#

beginners might not even realize that range and zip are types of objects. they would probably just see them as "the thing I use to write that kind of loop"

cyan spindle
cyan spindle
#

Depends if you define a callable a function.

misty dirge
#

(the embed should be updated.)

silent goblet
cyan spindle
#

(Seeing how it takes in inputs and produces an output, I'm perfectly fine calling it a function even if it is a class.)

silent goblet
cyan spindle
#

Maybe something to do with them requiring dunders. Both zip and reversed do, I believe.

silent goblet
# silent goblet `reversed` is also a class, which _is_ strange

But iter is a built-in function and not a class, instead it uses a hidden iterator class to support the getitem-based iteration protocol

>>> class Foo:
...     def __getitem__(self, idx): return 0
...     def __len__(self): return 5
...
>>> iter(Foo())
<iterator object at 0x7f33166b0370>
>>>
silent goblet
misty dirge
#

it might be a matter of whether the object has a __reversed__ method

silent goblet
#

Yes, if the object has __reversed__, then the output of that is used and not wrapped in reversed at all.

misty dirge
#

!e

from collections import deque
d = deque([1, 2, 3, 4, 5])
print(reversed(d))
worldly dewBOT
silent goblet
#

sometimes there isn't a better answer than "it just happens to have been made this way"

cyan spindle
#

So... how does reversed work if there is no __reversed__?

silent goblet
#

or "it's more idiomatic"

silent goblet
cyan spindle
#

And what if the object is an iterator?

misty dirge
#

!e

from collections import deque
d = deque([1, 2, 3, 4, 5])
print(reversed(iter(d)))
worldly dewBOT
silent goblet
cyan spindle
#

Got it, thanks lol

#

I'm now in that phase where I spam iterators everywhere

#

for thread owner's problem, I might have done

b = iter(str2)
for c in str1:
  print(f"{c} {next(b)}")
long python
#

i saw there was a whole debate about how range(len isn't effective?

misty dirge
#

yes, just ignore that

long python
#

what is zip

misty dirge
#

sorry, I thought we were in your help thread.

hoary gazelle
misty dirge
#

Hello @hoary gazelle , please explain what this is and how it's relevant to the channel topic. If it's not relevant, kindly remove it.

hoary gazelle
misty dirge
hoary gazelle
# hoary gazelle https://docs.google.com/document/d/10rQR937Mp8t3u036xD0Cl4lDibNla2WF_97A-b8Z6C8/...

This is a DRAFT of a FIRST script for a tutorial series thats NOT like others, its gonna be heavily animated 2d/3d, for VISUAL reference. I want to teach in a different way for people who dont have normal knowledge of computers (like myself 10 years ago). being told to "isntall vs code" and python, then typing some words in what looks like a text file, while saying "a varible is like a container" is dog water (in my opinion). so instead i aim to teach by giving a more "under the hood" explanation. the first script introduces basic (required) computer science topics that are dumbed down (hopefully enough) to where people can understand it (if heavily aided with visual reference).

I want YOU GUYS to read it and give comment! (commeing perms is on in the doc). things that should be added / removed / rephrased. this is a "first draft" (i technically wrote this a few other times but this was entirely rewritten). maybe this is "too much information" or it badly pased. idk. hence why i want others to read it and give me there opinion.

rain radish
#

Who told you to post it here?

misty dirge
civic stag
#

@queen heron i don't think the piano analogy is very good, they're trying to learn programming, not typing

#

nvm seems like we're on the same page

queen heron
civic stag
cinder rivet
delicate knot
#

excuse me guys, what does pedagogy mean?

native hearth
delicate knot
distant aurora
#

@upper flint which browser do you use?

upper flint
fallen inlet
#

I'm thinking to restore running an online syncs for UI+coding, 1-2 times a week.

misty dirge
#

This channel is for talking about methods and practices for teaching Python and related concepts, so make sure every message in this channel is about that.

trim juniper
#

I was thinking of a different way to teach programming. One really big problem I've faced in school is that the teachers go way too slow, going over things that get people bored and are too theoretical. I think it would be good to have project based learning courses where you basically just give people a list of projects to fix going from super easy to moderate until they understand a language a bit. Then telling them to do something with that knowledge. Then teaching them to bug fix, the technical errors they make, the ways they could be more effecient, and so on. I think that could teach it way faster.

misty dirge
#

Hello, please read the description of this channel.

vast mica
# trim juniper I was thinking of a different way to teach programming. One really big problem I...

I teach Python in the context of drawing stuff (some people would say, creative coding), I use the py5 library https://py5coding.org because it has a solid 2D and 3D graphics infrastructure inherited from https://Processing.org (used by artists and for teaching since 2001...). For school labs on Windows I've prepared a portable Thonny IDE with all I need pre-installed: https://abav.lugaralgum.com/como-instalar-py5/index-EN.html

trim juniper
misty dirge
#

@vestal axle your off-topic messages were removed

toxic remnant
# trim juniper I was thinking of a different way to teach programming. One really big problem I...

Personally, I find the project + minimal theory explanation style unhelpful. I need to know WHY and I don’t mind going into the weeds for it. There must be some kinda happy medium or something.

I’ve probably taken 4 beginner-intermediate classes like this from YouTube to LinkedIn and while I know a lot (relative), I feel like I know nothing anytime I’m faced with one of their challenges.

When I found Barron Stone, he was able to teach things in a way that related Python objects to real-life things. It was kinda corny, but it really was effective. I think what makes me gravitate to his classes is that he scratches my theoretical itches and explains more of the logical thought patterns you need to create code that solves problems (and yet, CoderPad remains the bane of my existence)

little turret
#

Are there recommended pedagogical approaches when it comes to teaching how to use a debugger like pdb? Should this start off with an introduction to the commands & then structured around certain types of bugs? or maybe structured around certain strategies like context grabbing by going up & down the stack while inspecting arg or local values?

So essentially, what would the structure of an ideal curriculum around this look like? or should there be more emphasis on inquiry-based learning & scaffolding, & what could this look like?

trim juniper
#

maybe it's just a pick your audience kind of thing

#

or potentially it's never been done right

toxic remnant
# trim juniper or potentially it's never been done right

It could also just be a 'me' thing. Perhaps the approach is fine and I'm just handicapping myself by not doing something else I should be doing outside of the course.

I considered that after I finished typing out my response but felt like I needed to wait on your reply to say anything lol
-# This server is kinda daunting and I didn't wanna risk being flagged for saying something unrelated to this channel, so by replying to you, I feel (at least I hope) I avoided this lol.

covert escarp
# little turret Are there recommended pedagogical approaches when it comes to teaching how to us...

I have been on both side of the spectrum, where I go over the theoritical apsect of the topic, particularly, when it entails making decisions that may not be clear cut of fine tunning. but it is usually in somewhat advance course. For beginner course, the goal / project oriented seems more approachable.
I have tried the theorethical approach at a beginner course, it did not go well at all. It looked like it was way too much information than necessary.

covert escarp
# toxic remnant Personally, I find the project + minimal theory explanation style unhelpful. I n...

For some people, it's the carrot and the stick approach, where they make soem progress, then, improve their understanding, and keep trucking on. Others will get lost in the weeds trying to understand everything. Of course we have the other spectrum of just brute forcing everything (probably not the best idea, but sometime works). I find that myself, I fluctuate between goal oriented, and understanding oriented even if there is not much of a goal.

little turret
toxic remnant
# covert escarp For some people, it's the carrot and the stick approach, where they make soem pr...

This def applies more nuance than I did—some things I feel require one approach and other things require another.

Like, if I’m tryna learn how to add this cool effect to some digital art on Procreate, I don’t need to know all the details as to why the “insert tool name here” does “desired effect”, I just need to know when/where to do it.

But for coding, I feel like without knowing the “why”, when it comes time for me to make my own projects, I’ll sit there staring at the blank IDE thinking “I know how to do list comprehensions and while loops, but how tf do I apply it to anything but these silly ‘quick brown fox’ ass examples I’ve seen for the past few months?”

#

I just think if more teachers would display real-world scenarios and WHY they chose to use the code they’re using in the moment, it would work wonders.

For example (just go with it, likely way off lol): In this lesson, we’ll discover list comprehensions. insert lesson here.

In my (specialty) career, I use list comprehensions to iterate through financial data that comes to me in a lists of tuples. The reason they come as a list of tuples is xyz and the list comprehension I use helps me to achieve abc in order to pass it on to the next developer who has to do def with it.

I hope any of that makes a semblance of sense but if not, I get it lol.

covert escarp
# toxic remnant This def applies more nuance than I did—some things I feel require one approach ...

This makes sense, however, one might add, this can be done by using a forloop instead of a list comprehension, and same exact result with be returned. However, let's run this experiment. let's run 1million (example) of these with a list comprehension, and same with for loop, and time the executions.
Then, the studends would ask, why is the list comprehension taking less time than the for loop, even though they do the same thing?
This then increases the curiosity of the student, rather than you having to teach them about optimization, when they don't even see the point.

toxic remnant
# covert escarp This makes sense, however, one might add, this can be done by using a forloop in...

Ah, I see some projection on my part. Because I take online courses where the class is a series of short videos with no way to communicate with the teacher, I assumed you were teaching in the same way.

If you were able to have dialogue with the student, I think that would be effective bc yea, the student like me would ask why one method is faster than the other.
-# as a follow up, I’d likely ask for resources that further explain optimization if there wouldn’t be a lecture/class dedicated to it later

sturdy gale
#

dang online coarses

drifting pelican
#

Can anybody tell me how to be a good coding teacher

atomic saddle
#

@drifting pelican teach me and I will tell everyone that you are a good coding teacher

wary raven
#

Everything else is just practice.

broken zealot
#

Hello i´m new here in the platform and i´m new programming

tame dagger
covert zenith
#

help

wary raven
elfin badge
#

…what is pedagogy?

misty dirge
misty dirge
elfin badge
#

My apologies…carry on 😅

bleak lantern
#

I'm curious how people would go about dealing with teaching with a class where there's a huge disparity of ability.

Some with a sincere ability who'd like to make great progress and some struggling with mid level stuff and some struggling with basics, and severely disengaged.

If you have a class of 20 such students... what would you do?

misty dirge
bleak lantern
#

Prior experience... well not really, they're just a little more engaged really.

wary raven
bleak lantern
#

But pedagogy-wise... I struggle to see how to actually make progress that's going to be meaningful across the cohort

wary raven
#

IMO no amount of focus on foundations goes wasted, and you can just stare at that from more angles

#

While letting some more-engaged or advanced students get extra credit for doing more

bleak lantern
wary raven
#

I mean, you can just re-start your explanation from the perspective of Measure Theory, or how the CPU works with electrons, etc, IMO

#

There's always stuff unknown to each student

bleak lantern
#

i'm talking about engagement and ability in python though

wary raven
#

Well, figure out why they aren't engaging with Python, I guess is what I'm saying..
and to do that, I'd re-present the idea in various ways

bleak lantern
#

I know why they aren't. They hate it.

silent goblet
#

are they forced to learn Python?

wary raven
#

That's an outcome/desire/etc, not a reason

#

That's like saying you know what killed someone because they are dead.

bleak lantern
#

I don't follow you.

#

Anyway - I was really getting at pedagogy and wondering if people have a split approach.

bleak lantern
wary raven
#

They currently hate Python. You should try to learn why. I used to hate Python.

bleak lantern
#

They feel like they're crap at it, and they'd rather go online and do some shopping, or play rugby.

wary raven
#

Treat it like an incident post-mortem

bleak lantern
#

Like in a very genuine way, it's insanely difficult and bizarre.

#

Meanwhile there are other students in the same class who thrive.

#

So... I know how to get the weak kids to be better, BUT I don't know how to do it at the same time as engaging the other half of the class.

#

Anyway, it doesn't feel like anyone wants to actually talk about the pedagogy side of it, which is what I'm curious to discuss.

wary raven
#

Well, what specifically are you looking for? An interesting UK study I've had trouble finding today did a "pre-test" that sorted people into two groups; ones that had answered questions in the test consistently, even if wrongly, and ones who hadn't. The second group needed special instruction to do well.

#

So your student pool is at least biomodal.

bleak lantern
#

Approaches to teaching this sort of group is what i'm looking for.

wary raven
#

OK, there's my proposal then; pre-test to figure out which "type" of computer programming student they are.

bleak lantern
#

That's nothing to do with pedagogy though

timber jungle
wary raven
#

?

bleak lantern
#

How?

#

I already know which people are which.

wary raven
#

If you don't think figuring out how your students learn to program is part of pedagogy, I don't know how to advise you.

timber jungle
bleak lantern
#

You're answering a problem I didn't pose.

timber jungle
#

I'm assuming this is some sort of classroom setting

bleak lantern
wary raven
#

Ask for the result you want to see, not the process you think that takes already. Same as when asking about a software problem, IMO.

timber jungle