-
Notifications
You must be signed in to change notification settings - Fork 4.3k
[Term Entry] Python Built-in Function: .id() #2486
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
[Term Entry] Python Built-in Function: .id() #2486
Conversation
|
Hello! I just made my first pull request for the term entry for the Python id() built-in function! I hope it gets approved. Thank you! 😊 |
dakshdeepHERE
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions from my side 🙂
|
|
||
| In this next example, we will execute the id() function with 2 **mutable** variables. | ||
| Take note of how they will return different values and 2 separate unique ids. | ||
| This is because mutable objects are able to change. Let's use the mutable **list** object to demonstrate this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This is because mutable objects are able to change. Let's use the mutable **list** object to demonstrate this: | |
| This is due to the mutability of objects. The mutable **list** object can be used to demonstrate this: |
| print(id(favAnimals)); | ||
| ``` | ||
|
|
||
| This example results in the following output: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This example results in the following output: | |
| This example results in the following output: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more changes
| ## Example | ||
|
|
||
| In the example below, when the 2 **immutable** variables are executed via the id() function, | ||
| they return the same value pointing to the same location in memory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| they return the same value pointing to the same location in memory. | |
| the returned value is the same, indicating the same memory location. |
|
|
||
| In the example below, when the 2 **immutable** variables are executed via the id() function, | ||
| they return the same value pointing to the same location in memory. | ||
| This is because immutable objects don't change. Let's use the immutable **string** object to demonstrate this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This is because immutable objects don't change. Let's use the immutable **string** object to demonstrate this: | |
| This is due to the immutability of objects. The immutable string object will be used to demonstrate this: |
|
@Churreesha after you've reviewed @dakshdeepHERE's user suggestions, tag me and I can do a maintainer review. (I don't want to do so before you have a chance to review those edits.) |
|
@dakshdeepHERE Thank you so much for reviewing my work and making suggestions. I greatly appreciate it! 😊 and @SSwiniarski I have finished looking at the suggestions and I am now ready for your maintainer's review! 😊 |
|
@SSwiniarski and @dakshdeepHERE Just a quick question, when I do the changes to file, how exactly should I do that? Do I just directly edit the pull request file here on GitHub with the appropriate changes? Or do I go back into my VS Code text editor and make the changes there then push the changes back up here to Github? Sorry, this is my first time doing this. 😅 |
|
@Churreesha no you don't have to do the same changes on VS again. So if you have done changes on GitHub first means your changes are on remote branch so to reflect the changes locally go to your local file and type git pull origin branch_name (branch where you committed the changes on github). This will pull the changes you did on github to your local files. Let's say you did changes on VS code first then you have to push the changes here so they can reflect over here(on remote branch). There can be one more possibility if you did changes on Github and also did changes on VS code then you try to push it. Well you might end up with merge conflicts so it's better to follow the above two step's instead. Don't ever forget to pull the changes from remote branches to local branches. Hope this helped you if not I can explain you again 🙂. Also so sorry for this long explanation.😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Churreesha I went through and made some comments. Many overlap @dakshdeepHERE's comments that didn't appear to have been applied. Make sure if you make the changes locally, that you push them to the remote repo. Make sure you tag me when the changes have been applied and I do another pass through the entry.
|
|
||
| ## Example | ||
|
|
||
| In the example below, when the 2 **immutable** variables are executed via the id() function, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| In the example below, when the 2 **immutable** variables are executed via the id() function, | |
| In the example below, when two **immutable** variables are executed using the id() function, |
| print(id(goodbye)) | ||
| ``` | ||
|
|
||
| ## Codebyte Example 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally have only one codebyte, so I'd pick one or the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have deleted the second codebyte so now it's officially only one! 😊
|
|
||
| ## Codebyte Example 2 | ||
|
|
||
| The following example displays the output of the mutable **dictionary** object: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The following example displays the output of the mutable **dictionary** object: | |
| The following example displays the output of the mutable `dictionary` object: |
I have added the wonderful suggestions! Thank you so much! The only thing I have to do now is to delete the second codebyte example as it was suggested that it's not needed. I will do that in VS Code and push the changes here! 😊 Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> Co-authored-by: Daksha Deep <dakshadeep1234@gmail.com>
I deleted the second codebyte example
I made additional suggested changes eliminating extra white space! 😊 Co-authored-by: Daksha Deep <dakshadeep1234@gmail.com>
Thank you so much for this advice! It was extremely helpful! 😊❤️ |
|
Hello @SSwiniarski and @dakshdeepHERE I have applied the wonderful lovely suggestions you have made for my document! I greatly appreciate the suggestions and applied the changes accordingly. I did everything right here in Github! I was about to delete the second codebyte example in VS Code, but then I realized that I could just do it here! Thank you once again for reviewing my document! I hope that it's fitting to Codecademy's standards! 😊❤️ |
Co-authored-by: Daksha Deep <dakshadeep1234@gmail.com>
Happy to help you 😊 I'm happy it worked out for you. |
Awsm to have you here with us. Don't forget to use git pull origin branch_name on your local device so the changes here will be done on your local files too. |
… to content/python/concepts/built-in-functions/terms/id/id.md
SSwiniarski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Churreesha, I did a few edits removing extra line breaks, and I also moved the file because it wasn't in the proper location. It was in content/python/concepts/built-in-functions/id/id.md instead of content/python/concepts/built-in-functions/terms/id/id.md.
Now it's ready for a second review.
caupolicandiaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Churreesha Looks good. I did make several edits addressing line breaks and other minor formatting issues. Please review the changes for future reference.
|
👋 @Churreesha |
|
@Churreesha congrats on the new entry. Live link here: https://www.codecademy.com/resources/docs/python/built-in-functions/id You're currently anonymous. If you don't wish to be anonymous, check out this forum thread on how to link your GitHub and Codecademy profiles: https://discuss.codecademy.com/t/my-contribution-is-live-but-im-not-being-shown-as-a-contributor-why-is-this/758036 Note: it may take a few minutes for the change to register on the entry page. |
|
@SSwiniarski and @dakshdeepHERE and @caupolicandiaz Thank you so much everyone! I'm so happy! 🥺Thank you for making improvements and edits to my document! I greatly appreciate it! Thank you so much! 😊❤️ Just a quick question, can I mention this contribution on my resume and portfolio as opensource experience or no? Thank you. ❤️✨ |
I will do this thank you! ❤️ |
Thank you so much! ❤️ |
Thank you for this! ❤️ |
@Churreesha Yes! This can be listed in your resume and portfolio as volunteer "open contribution" experience. |
|
@yangc95 This is awesome! Thank you so much, I appreciate it! ❤️ |
|
This is my first entry in the Codecademy course "Git & GitHub". So, this is just training work. |
|
@NikolaPopovic71 I don't see any issues you've been assigned to or entries opened up under your current GitHub name. Can you clarify what your first entry is? If you're looking to contribute, check out the issues tab and look for issues that aren't taken yet. Hope this helps! |


Description
Type of Change
Checklist
mainbranch.