pcc_2e | Online resources for Python Crash Course | Learning library
kandi X-RAY | pcc_2e Summary
kandi X-RAY | pcc_2e Summary
Python Crash Course - Second Edition ===. A Hands-On, Project-Based Introduction to Programming ---. This is a collection of resources for [Python Crash Course, Second Edition] an introductory programming book from [No Starch Press] by Eric Matthes. Click here for a [much cleaner version] of these online resources.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pcc_2e
pcc_2e Key Features
pcc_2e Examples and Code Snippets
Community Discussions
Trending Discussions on pcc_2e
QUESTION
I would like to ask a question related to Python 'class', because I got stuck on this example while I was practicing exercise 9.8 on this site: https://ehmatthes.github.io/pcc_2e/solutions/chapter_9/#9-9-battery-upgrade
Example: Write a separate Privileges class. The class should have one attribute, privileges, that stores a list of strings as described in Exercise 9-7. Move the show_privileges() method to this class. Make a Privileges instance as an attribute in the Admin class. Create a new instance of Admin and use your method to show its privileges.
...ANSWER
Answered 2021-Jul-05 at 07:10The answer given on the site is wrong.
If you want an optional list of privileges, you need a default parameter value. Note that because []
is a mutable value, you need to use something like None
and replace it with a new empty list inside the function.
QUESTION
I use several books for coding studies. Many of them have coding examples that link back to a GitHub, for example: https://github.com/ehmatthes/pcc_2e/
If I want to make changes to the code, for example add comments, experiment with the code some more etc. for personal use, should I fork or clone the repository in order to keep my changes in the cloud?
If I clone, it seems I can only keep changes in GitHub if I commit and push to a branch, which I don't want to do since I'm not fixing or enhancing anything.
However if I fork, I believe forking implies I also want to contribute back, so I'm not sure if that is right. I'm aware I can commit and push to my fork without doing a pull request back to the original, however I'm not sure if conceptually that is the correct way, since Forks again are meant to be potential code contributions to the original author.
TLDR: I want to get the latest course code from a GitHub repo, play with the code in some files, and have my notes\code changes on GitHub. How do I meet those needs in GitHub?
...ANSWER
Answered 2020-Jun-13 at 06:29To clone is simply to download it locally and use it. The content of the repo can be enhanced anytime. And this will not be reflected in your Cloned Directory.
So, I think you should prefer to fork the course repository. This will also help you to see any new changes that are made to that repository and stay updated. Here are the steps to sync your repo with the original one, without loosing out on local changes. Later on if you wish to contribute, you can do that too.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pcc_2e
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page