Skip to content
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 sets .issubset() #4613 #4634

Merged
merged 8 commits into from May 10, 2024

Conversation

jesacebar
Copy link
Contributor

Description

Added a term entry that describes the Python set method issubset().

Issue Solved

Closes #4613

Type of Change

  • Adding a new entry

Checklist

  • All writings are my own.
  • My entry follows the Codecademy Docs style guide.
  • My changes generate no new warnings.
  • I have performed a self-review of my own writing and code.
  • I have checked my entry and corrected any misspellings.
  • I have made corresponding changes to the documentation if needed.
  • I have confirmed my changes are not being pushed from my forked main branch.
  • I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • I have linked any issues that are relevant to this PR in the Issues Solved section.

@CLAassistant
Copy link

CLAassistant commented May 8, 2024

CLA assistant check
All committers have signed the CLA.

@jesacebar jesacebar changed the title Add Python sets issubset() term entry [Term Entry] Python sets .issubset() #4613 May 8, 2024
@mamtawardhani mamtawardhani self-assigned this May 8, 2024
@mamtawardhani mamtawardhani added python Python entries new entry New entry or entries status: under review Issue or PR is currently being reviewed labels May 8, 2024
Copy link
Collaborator

@mamtawardhani mamtawardhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jesacebar! Thank you for Contributing at Codecademy Docs! The entry was well written!

I've added just a few suggestions, could you please review and modify them at your earliest convenience?
Thank you!

Comment on lines 1 to 15
---
Title: ".issubset()"
Description: "Returns True if all elements in a set exist in another; otherwise, it returns False."
Subjects:
- "Code Foundations"
- "Computer Science"
Tags:
- "Collections"
- "Functions"
- "Methods"
- "Sets"
CatalogContent:
- "learn-python-3"
- "paths/computer-science"
---
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
---
Title: ".issubset()"
Description: "Returns True if all elements in a set exist in another; otherwise, it returns False."
Subjects:
- "Code Foundations"
- "Computer Science"
Tags:
- "Collections"
- "Functions"
- "Methods"
- "Sets"
CatalogContent:
- "learn-python-3"
- "paths/computer-science"
---
---
Title: '.issubset()'
Description: 'Returns `True` if all elements in a set exist in another; otherwise, it returns `False`.'
Subjects:
- 'Code Foundations'
- 'Computer Science'
Tags:
- 'Collections'
- 'Methods'
- 'Sets'
CatalogContent:
- 'learn-python-3'
- 'paths/computer-science'
---

- "paths/computer-science"
---

The **`issubset()`** method returns True if all of the elements in a set exist within another given set. If all of the elements are not contained within the given set, it will return False instead.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The **`issubset()`** method returns True if all of the elements in a set exist within another given set. If all of the elements are not contained within the given set, it will return False instead.
The **`.issubset()`** method returns `True` if all elements in a set exist within another specified set. If any elements are not contained within the specified set, it returns `False`.

Comment on lines 22 to 25
set_A.issubset(set_B)

# Alternatively, a shorter syntax version can be used to do the same thing.
set_A <= set_B
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set_A.issubset(set_B)
# Alternatively, a shorter syntax version can be used to do the same thing.
set_A <= set_B
set.issubset(set1)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just below the syntax, please describe the parameters like:

  • set: Parameter description
  • set1: Parameter description

Comment on lines 50 to 51
print(x.issubset(y)) # True, because y contains all of the elements in x.
print(x.issubset(z)) # False, because z doesn't contain all of the elements in x.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(x.issubset(y)) # True, because y contains all of the elements in x.
print(x.issubset(z)) # False, because z doesn't contain all of the elements in x.
print(x.issubset(y))
print(x.issubset(z))

print(set_A.issubset(set_B))
```

This would print `True`, because `set_B` contains all of the elements in `set_B`:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This would print `True`, because `set_B` contains all of the elements in `set_B`:
This would print `True`, because `set_B` contains all of the elements in `set_B`. It produces the following output:


This would print `True`, because `set_B` contains all of the elements in `set_B`:

```py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```py
```shell

@jesacebar
Copy link
Contributor Author

jesacebar commented May 9, 2024

Hello, @mamtawardhani. Thank you for your suggestions! I believe I have covered all of them with my most recent changes.

Copy link
Collaborator

@mamtawardhani mamtawardhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making the required changes @jesacebar!

Looks good for the next review!👍

Copy link
Collaborator

@letsbuildanything letsbuildanything left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jesacebar I've requested some changes. Please take a moment to address them. If you have any concerns or reasons to reject specific suggestions, feel free to discuss them.

@@ -0,0 +1,51 @@
---
Title: '.issubset()'
Description: 'Returns True if all elements in a set exist in another; otherwise, it returns False.'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Description: 'Returns True if all elements in a set exist in another; otherwise, it returns False.'
Description: 'Checks whether all elements in one set exist within another specified set.'

- 'paths/computer-science'
---

The **`.issubset()`** method returns `True` if all elements in a set exist within another specified set. If any elements are not contained within the specified set, it returns `False`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The **`.issubset()`** method returns `True` if all elements in a set exist within another specified set. If any elements are not contained within the specified set, it returns `False`.
The **`.issubset()`** method checks whether all elements in one set exist within another specified set. It returns `True` if this condition is met; otherwise, it returns `False`.

## Syntax

```pseudo
set.issubset(set1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set.issubset(set1)
set1.issubset(set2)

Comment on lines 24 to 25
- `set`: The set whose elements are being checked for existence within `set1`.
- `set1`: The set being searched for the presence of elements from the `set`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `set`: The set whose elements are being checked for existence within `set1`.
- `set1`: The set being searched for the presence of elements from the `set`.
- `set1`: The set whose elements are being checked for existence within `set2`.
- `set2`: The set being searched for the presence of elements from the `set1`.

- `set1`: The set being searched for the presence of elements from the `set`.

## Example

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The following example demonstrate the usage of `.issubset()` method:

@jesacebar
Copy link
Contributor Author

Hello, @letsbuildanything. Thank you for your suggestions as well! I think I covered all of them in the latest changes.

Copy link
Collaborator

@letsbuildanything letsbuildanything left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@letsbuildanything letsbuildanything merged commit 9556def into Codecademy:main May 10, 2024
6 checks passed
Copy link

👋 @jesacebar
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out this four question survey to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!

🎉 Your contribution(s) can be seen here:

https://www.codecademy.com/resources/docs/python/sets/issubset

Please note it may take a little while for changes to become visible.
If you're appearing as anonymous and want to be credited, see here.

achur00 pushed a commit to achur00/Codecademy-docs that referenced this pull request May 11, 2024
* Add Python sets issubset() term entry

* Improve some sentences and format in Python issubset() term entry

* Update issubset.md

* Update issubset.md

* Modify descriptions and variable names in issubset() term entry

* Improve grammar of sentence in issubset() term entry

---------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Term Entry] Python sets .issubset()
4 participants