You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to start a discussion around Ex 6 and strings before I be so bold as to make a pull request, seeing as one has just been made for this lesson.
I've currently completed about half the course and have written up a little under that. With the switch to Python 3.6 I'm reviewing all my old write ups and converting then to follow the new Python 3.6 syntax.
In doing so I've identified Ex 6 as one of the most important early lessons that was crucial to understand as a new learner - it was for me at least.
The Python 2.7 exercise introduced conversion flags (I think they're called that) like %r.
My write up on this lesson can be seen here and should give a window into the mind of a learner.
My proposed write up for lesson 6 with the Python 3.6 update is here.
I have written the lesson script my own way like so:
x="There are {!a} types of people.".format(10)
binary="binary"do_not="don't"y=f"Those who know {binary} and those who {do_not}."print(x)
print(y)
print(f"I said: {x!r}")
print(f"I also said: '{y}'")
hilarious=Falsejoke_evaluation="Isn't that joke so funny?! {}"print(joke_evaluation.format(hilarious))
w="This is the left side of..."e="a string with a right side."print(w+e)
This version does step back to some pre 3.6 syntax but delivers the overall 'intent' as I experienced it from the 2.7 version of the book.
Conversion flags
My proposed line introduces the conversion flag on line one. One is also used again on line 14 where is prints the 'quote' marks, in contrast to line 16 which doesn't and needs them manually added.
Yes, this is a subtle distinction, but this is learning the 'hard' way so having these little indicators of differences and chasing them down rounds out understanding. It certainly did for me at least as you can see from my write up where I chased down what these things were and what they did.
< 3.6 syntax
Line one also introduces the < 3.6 syntax for formatting strings. I think this is important, particularly for Ex 23 where you read some external projects that will likely not follow the 3.6 syntax.
It's also important because this syntax is used on line 21 of the script to print the variable 'hilarious' inside the 'joke_evaluation' string. Showing two example of this syntax indicates to the learner that it's not 'special' and implies to look into it. At least it did to me.
I know this is subtle
I get that I'm diving into the weeds here but the original lesson was actually very powerful at foreshadowing some of what was coming later. It helped with lessons like Ex 8 and Ex 11 for example. Yes, those lessons now use the 3.6 syntax and there's an argument for not confusing new learners, but getting a little under the hood and understanding there are different ways to do this in Python would be useful I think - particularly with the mess over the way Python has changed the way it handles strings.
I appreciate that there has to be a choice of which version of string handling to teach however a little intro to the intricacies early on before keeping with the 3.6 syntax might help overall.
The text was updated successfully, but these errors were encountered:
I'd like to start a discussion around Ex 6 and strings before I be so bold as to make a pull request, seeing as one has just been made for this lesson.
I've currently completed about half the course and have written up a little under that. With the switch to Python 3.6 I'm reviewing all my old write ups and converting then to follow the new Python 3.6 syntax.
In doing so I've identified Ex 6 as one of the most important early lessons that was crucial to understand as a new learner - it was for me at least.
The Python 2.7 exercise introduced conversion flags (I think they're called that) like
%r
.My write up on this lesson can be seen here and should give a window into the mind of a learner.
My proposed write up for lesson 6 with the Python 3.6 update is here.
I have written the lesson script my own way like so:
This version does step back to some pre 3.6 syntax but delivers the overall 'intent' as I experienced it from the 2.7 version of the book.
Conversion flags
My proposed line introduces the conversion flag on line one. One is also used again on line 14 where is prints the 'quote' marks, in contrast to line 16 which doesn't and needs them manually added.
Yes, this is a subtle distinction, but this is learning the 'hard' way so having these little indicators of differences and chasing them down rounds out understanding. It certainly did for me at least as you can see from my write up where I chased down what these things were and what they did.
< 3.6 syntax
Line one also introduces the < 3.6 syntax for formatting strings. I think this is important, particularly for Ex 23 where you read some external projects that will likely not follow the 3.6 syntax.
It's also important because this syntax is used on line 21 of the script to print the variable 'hilarious' inside the 'joke_evaluation' string. Showing two example of this syntax indicates to the learner that it's not 'special' and implies to look into it. At least it did to me.
I know this is subtle
I get that I'm diving into the weeds here but the original lesson was actually very powerful at foreshadowing some of what was coming later. It helped with lessons like Ex 8 and Ex 11 for example. Yes, those lessons now use the 3.6 syntax and there's an argument for not confusing new learners, but getting a little under the hood and understanding there are different ways to do this in Python would be useful I think - particularly with the mess over the way Python has changed the way it handles strings.
I appreciate that there has to be a choice of which version of string handling to teach however a little intro to the intricacies early on before keeping with the 3.6 syntax might help overall.
The text was updated successfully, but these errors were encountered: