-
-
Notifications
You must be signed in to change notification settings - Fork 37.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Future Python Curriculum [Discussion] #14588
Comments
Here is what we can add::
Intermediate:
Advanced:
|
@mstellaluna Thank you for your recommendations. What would be the difference between the Beginner conditional section and the Intermediate conditional section? |
@Ethan-Arrowood for me the basics should just be imo the minimal knowledge (if, else, for, which) . My entry for the "conditional" in the intermediate would be conditionals based on user input or ternary statements.. same thing for print formatting .. basic would be a simple print statement whereas intermediate we can introduce print statements with variables, the %s .. etc |
Repl.it has new area for creating custom classrooms. You can create assignments with instructions. Repl.it Classrooms List of Community classrooms |
I suggest adding basic, intermediate and advanced algorithm sections (similar to what FCC Front End curriculum has for JavaScript). |
I have looked at the FCC-Python-Variable-Challenge example given, and I noticed that the challenge expects a bit of ‘prerequisites’ knowledge. As if the camper had been introduced to variables before. The Description/Explanation for the variable challenge does not explain what variables are. Unlike JavaScript’s Declare JavaScript Variables challenge, which goes into a bit of an introduction about what variables are. I know this is just an example – but just to be sure – are we going to assume that the camper already went through the JavaScript curriculum while building the Python curriculum? |
@jamesperrin Yes we looked into that but we are trying to keep the user on FCC's site so the challenges must be embedded. Furthermore there is no way for us to access the results of the unit tests of the Repl Classrooms. |
@u-ways Yeah that was my mistake. The goal is for this to be an independent curriculum so the actual explanations will be much more detailed (like the JS version). Thank you for you highlighting this :) |
@AnikaErceg these will be great practice sections. Will definitely keep it in mind. Thank you! |
@Ethan-Arrowood You might want to include the Natural Language Toolkit. |
I added list comprehensions to intermediate |
How about decorators under advanced? I assume context managers will come up during the file handling? |
@t3h2mas I put decorators under intermediate. |
If you added |
@AnikaErceg good suggestion. Done. I added is and is not as well. |
@ginoskotheon You forgot to add |
I'm a developer who's first language was Python...I already help out with my local FCC chapter and the organizer suggested I might like to assist with the new curriculum. I'm not 100% sure how to start contributing, but I would definitely like to. I'm also quite active in the Python community, both locally and at large, so I can get lots of knowledgeable eyes when it's needed. My first suggestions:
|
@cldershem So many great suggestions thank you! With your experience, the best kind of contributions you can make are writing the lessons/challenges themselves. Let me know which ones you'd be interested in writing 😄 |
https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Pull-Request-Contribute Might point you in the right direction. Maybe @Ethan-Arrowood would take submissions through Github comments as well? |
@t3h2mas Yes, as I said at the very top lesson/challenge submissions can be done right here on this thread as comments 😄 |
@cldershem Another way you can help is if you know of a good way to create an in browser challenge that can actually be tested (with unittest). We're exploring all kinds of options form REPL.it to codeMirror to Skulpt. |
@cldershem I probably should write "escape characters". Those are things like '\n', '\t', etc. And I know they're iterables but I am starting to break things up in terms of individual bite-sized lessons. By the way, thanks for all of the suggestions and all of the help. I'm planning on working on a sample lesson/challenge over the weekend and hopefully it can be a kind of template for others. If you want to tackle a lesson/challenge that functions similarly to how Free Code Camp challenges work, then please post your code. I would love to see that. |
@Ethan-Arrowood @ginoskotheon @cldershem |
Hey guys, I'm founder/ceo of Repl.it. FCC is near and dear to our hearts so we'll do whatever we can do so we can support here. What are the major hurdles to adopting Repl.it classrooms for this? |
@amasad hello! Glad to have you here 😄 Any ideas on how we could implement this? FCC is written in JavaScript so any sort of web api or npm module would work pretty well. |
If you think many of your viewers will come from the JavaScript background, I think a primer on the differences would be useful. For example
Another example would be looping through a dictionary or array with for loops. This trips me up all the time. |
Title Introduction to Lambdas Description/Explanation/Lesson 1 http://stackoverflow.com/questions/890128/why-are-python-lambdas-useful "An anonymous function (function literal, lambda abstraction) is a function definition that is not bound to an identifier." [5] The word "Lambda comes from the Lambda Calculus" [4]. In python, a lambda is an keyword for defining an anonymous function. Using the >>> def f (x): return x**2
>>> print f(8)
64
>>> g = lambda x: x**2
>>> print g(8)
64 src 2 The most common use cases are to keep code short and readable, instead of splitting definition and use as per this example: def __init__(self, parent):
"""Constructor"""
frame = tk.Frame(parent)
frame.pack()
btn22 = tk.Button(frame,
text="22", command=self.buttonCmd22)
btn22.pack(side=tk.LEFT)
btn44 = tk.Button(frame,
text="44", command=self.buttonCmd44)
btn44.pack(side=tk.LEFT)
def buttonCmd22(self):
self.printNum(22)
def buttonCmd44(self):
self.printNum(44) src 3 In this Tkinter GUI interface, a function must be passed to the command attribute. The functions are named with numbers because they were generated with a RAD builder. This is fine and functional, but not very legible. You can rename them and that does make things clearer, but if you had many buttons it could become cumbersome to go seeking through the code to find the right command, and since they just return a basic value, a better solution would be to define the function right there, anonymously: frame = tk.Frame(parent)
frame.pack()
btn22 = tk.Button(frame,
text="22", command=lambda: self.printNum(22))
btn22.pack(side=tk.LEFT)
btn44 = tk.Button(frame,
text="44", command=lambda: self.printNum(44))
btn44.pack(side=tk.LEFT) src 3 Another key feature of this use is that it makes the code shorter as well, meaning it is more readily available for the programmer when seeking a tool as part of a larger solution. Code Prompt/Challenge Pre-defined Code # only edit below this line
def y(z):
return abs(5-z)
print(sorted([1, 2, 3, 4, 5, 6, 7, 8, 9], key=y)) src 1 Solution |
@robbiemu great work! My only suggestion would be to add a comment in the Pre-defined Code section next to the print line that says something like |
Ethan, thank you. I'll continue to work on this. The problem and solution could be changed so there are reasonable tests as well (not using a static data set, as I have here). I'd like to see an example lesson for the best approach to do this. |
This is one of the code challenges for the Beginner - Math section listed at the beginning of this thread. Title -- Absolute Value Description/Explanation/Lesson --
Code Prompt/Challenge -- Pre-defined Code --
Solution --
Tests --
|
@bgroveben LGTM. good work! |
@Ethan-Arrowood Thank You! I have also written lessons for the other basic/math challenges listed above. I can post each of them on this thread if you'd like. Also, I think it would be a good idea to include round(), sum(), max(), and min() with the math basics lessons -- they will come in handy. |
@bgroveben I'll mark it as completed and yes please. Do each challenge in a separate comment too please; it'll be easier to reference for changes or whatever. Thank you for your contributions! |
Glad to be here 💃
The easiest is that we bake it in. Have a setting on the teacher side of things that says "auto-advance" or something. (We're not against adding webhooks etc, but for the sake of reducing complexity) Would that work? |
@amasad using an "auto-advance" feature we would surely be able to emulate FreeCodeCamp in a Repl.it classroom, but we still wouldn't be able to track user progress on FCC's end which is pretty crucial to the feel of FCC. What about a feature that lets us GET/POST data of a 'Classroom'. This way we could do something like:
or better yet:
Now both of these methods would run on our end, but because the REPL Classroom is embedded via an iframe we would at least need some simple event triggers from REPL's side in order to properly track individual user progress. Furthermore, because the Classroom would be embedded via an iframe, could we potentially get a feature that when a user completes a lesson the REPL Classroom runs some lines of JavaScript (that we can define via the Teachers portal) so we can get the classroom to communicate with FCC? We hope to be able to use REPL classrooms for not just Python, but other languages as well. Once the FCC Python Curriculum is up and running successfully we will move on to implement languages like Java or C++ (or literally any language that REPL can offer us to use!). I'd love to get @QuincyLarson opinion on this as well as some other main FCC contributors (I'll try reaching out to them on Gitter/Forums). |
Hi everyone, thanks a lot for the comments and suggestions. @amasad Thanks for taking the time to share your thoughts and ideas here. Its great to know that REPL.it is working on the classroom product, which we would love to integrate within the platform. For starters, it would be great if we can take this up in a separate discussion instead of this curriculum thread, to keep it more relevant to the integration itself. @Ethan-Arrowood Awesome job with the initiative. Thanks for your hard work. |
@amasad @QuincyLarson I have officially moved the REPL classroom discussion to this issue thread (per @raisedadead recommendation). #14736 |
following up on the comment by cldershem (commented 8 days ago), here's one for Titlenamedtuples Description/Explanation/Lesson1 https://en.wikipedia.org/wiki/Tuple A tuple is a concept common in mathematics. It is considered a finite ordered list of elements.[1] In python, these are functionally similar to dictionaries, where keys are defined in advance. Namedtuples can be used to provide a quick property tree for any use: like if your app must deal with socks and all socks have a size and a price, then a tuple with two fields is useful, approximating the dictionary
from [3] Code Prompt/ChallengeA good use of namedtuples is to facilitate ingesting data, like from a csv export from a database. In the following code, fix this CSV import with a tuple. Pre-defined Code
derived from [4] note: the above uses an actual file, but we could replace the Solution
Lesson 2: Titlenamedtuples._make Description/Explanation/Lesson1 https://docs.python.org/3.6/library/collections.html#collections.namedtuple A method of NamedTuples called _make facilitates the generation of instances within an iterator function.This would make the problem from the previous lesson even more terse.
Code Prompt/ChallengeWe are revisiting the previous lesson and revising the code. It's almost there, but the job is unfinished. For your convenience, some records are printed out where you should process the record. Remember, we need to create an EmployeeRecord and pass that to a function elsewhere in the code, like:
Pre-defined Code
Solution
We could probably also use quick lessons illustrating:
|
Here are the rest of the beginner math challenges: |
Title: Python Addition Description/Explanation/Lesson: In Python, an integer (int) is one of 3 distinct numeric types.
Code Prompt/Challenge: Change the 0 so that total will equal 20. Pre-defined Code:
Solution:
Tests:
|
Title: Description/Explanation/Lesson: Divmod takes two (non complex) numbers as arguments and returns a pair of numbers consisting of their quotient and remainder when using integer division.
Code Prompt/Challenge: In this exercise, variables a and b are defined for you. Pre-defined Code:
Solution:
Tests:
|
Title: Python Exponents Description/Explanation/Lesson: Python uses the double asterisk (**) operator to handle exponentiation.
Code Prompt/Challenge: In the console, you are given two variables, a and b. Pre-defined Code:
Solution:
Tests:
|
Title: Python Float Division Description/Explanation/Lesson: Python 3 distinguishes between integer (floor) division and float (true) division.
Code Prompt/Challenge: When you run the existing code, the variable named quotient will have a value of 1.0. Pre-defined Code:
Solution:
Tests:
|
Title: Python Integer Division Description/Explanation/Lesson: Python 3 distinguishes between integer (floor) division and float (true) division.
Code Prompt/Challenge: When you run the existing code, the variable named quotient will have a value of 1. Pre-defined Code:
Solution:
Tests:
|
Title: Python Maximum Value Description/Explanation/Lesson: The function max() returns the largest item in an iterable (like a list or string), or the largest of two or more arguments.
Code Prompt/Challenge: The starter code has a list of numbers named, well, numbers. Pre-defined Code:
Solution:
Tests:
|
Title: Python Minimum Value Description/Explanation/Lesson: The function min() returns the smallest item in an iterable (like a list or string), or the smallest of two or more arguments.
Code Prompt/Challenge: The starter code has a list of letters named, well, letters. Pre-defined Code:
Solution:
Tests:
|
Title: Python Multiplication Description/Explanation/Lesson: Python uses the asterisk (*) operator for multiplication.
Code Prompt/Challenge: Change the 0 so that product will equal 80. Pre-defined Code:
Solution:
Tests:
|
Title: Python Remainder Description/Explanation/Lesson: The % (modulo) operator yields the remainder from the division of the first argument by the second.
A simple way to determine if a number is odd or even is to check the remainder when that number is divided by 2.
Code Prompt/Challenge: Set the variable remainder equal to the remainder of 11 divided by 3 using the modulo (%) operator. Pre-defined Code:
Solution:
Tests:
|
Title: Python Rounding Description/Explanation/Lesson: The function round(number, n-digits) returns a given number rounded to n-digits precision after the decimal point.
Code Prompt/Challenge: The variable longer_pi has too many digits after the decimal place. Pre-defined Code:
Solution:
Tests:
|
Title: Python Square Root Description/Explanation/Lesson: The math.sqrt() function is a part of Python's math module, which is always available but must be imported.
Code Prompt/Challenge: The variable square_root is defined as the number 81. Pre-defined Code:
Solution:_
Tests:
|
Title: Python Subtraction Description/Explanation/Lesson: In Python, an integer (int) is one of 3 distinct numeric types.
Code Prompt/Challenge: Change the 0 so that total will equal 10. Pre-defined Code:
Solution:
Tests:
|
Title: Python Sum Description/Explanation/Lesson: The function sum(iterable) adds all of the items in a Python iterable (list, tuple, and so on) from left to right and returns the total.
Code Prompt/Challenge: There are two lists of numbers. Pre-defined Code:
Solution:
Tests:
|
I think that covers all of the lessons listed in the basics/math section. |
Please note - we are moving discussion of our Python coding challenges to this new repository: https://github.com/freeCodeCamp/python-coding-challenges/issues |
Posting here for reference:
|
Python Curriculum
This issue will be the main thread for planning & developing the future FCC Python Curriculum.
For any discussion about Integrating REPL.it Classroom please visit #14736 instead
We are currently working on running a verifiable Python test suite on an iframe Repl.it widget. Once we get that to work we will begin implementing the laid out curriculum defined in this thread. If you are interested in developing this part of the FCC Python curriculum please message myself (Ethan Arrowood) on Gitter or comment below.
Please note to write all Python challenges in version 3.6
The current structure for the FCC Python Curriculum is: Beginner Section, Intermediate Section, & Special Topic Section.
Beginner Section:
Intermediate Section:
Special Topic Section:
Have an idea for an section lesson?
Comment below and please specify which Section it should be added to and why.Want to develop the curriculum for a lesson?
Comment below the following details:Want to make changes to an existing lesson?
Provide your updates with detailed explanations why you are making the given changes.Coming Soon
-How to Propose a Python Challenge
https://github.com/freeCodeCamp/freeCodeCamp/tree/feature/python-challenges
Proposing a Python challenge? Make a PR against this branch with your challenge lessons and tests.The text was updated successfully, but these errors were encountered: