Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Write a function `pull_primes(list)`, where the list contains 4 positive integers between 0 and 169 (not included), that determines if any of the numbers are primes and adds them to the list `only_primes` that includes only the primes (make sure that the primes are in ascending order), if there are none, return `There are no prime numbers in this list`.
For the sake of simplicity, assume that we only care for the prime factors 2, 3, 5, 7 and 11
For example:
- `pull_primes([1, 3, 12, 14])` → `[1, 3]`
- `pull_primes([12, 13, 41, 62])` → `[13, 41]`
- `pull_primes([12, 14, 16, 18])` → `There are no prime numbers in this list`
**Hint:** Modulo is required

Write a function `pull_primes(list)`, where the list contains 4 positive integers between 0 and 169 (not included), that determines if any of the numbers are primes and adds them to the list `only_primes` that includes only the primes (make sure that the primes are in ascending order), if there are none, return `There are no prime numbers in this list`.
For the sake of simplicity, assume that we only care for the prime factors 2, 3, 5, 7 and 11

For example:
- `pull_primes([1, 3, 12, 14])` → `[1, 3]`
- `pull_primes([12, 13, 41, 62])` → `[13, 41]`
- `pull_primes([12, 14, 16, 18])` → `There are no prime numbers in this list`

**Hint:** Modulo is required
44 changes: 22 additions & 22 deletions pull-primes/io.json → list_2_iterating/pull-primes/io.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[
{
"input": [[1, 3, 5, 7]],
"output": [1, 3, 5, 7]
},
{
"input": [[20, 33, 46, 52]],
"output": "There are no prime numbers in this list"
},
{
"input": [[12, 13, 14, 15]],
"output": [13]
},
{
"input": [[52, 77, 81, 97]],
"output": [97]
},
{
"input": [[120, 127, 131, 160]],
"output": [127, 131]
}
]
[
{
"input": [[1, 3, 5, 7]],
"output": [1, 3, 5, 7]
},
{
"input": [[20, 33, 46, 52]],
"output": "There are no prime numbers in this list"
},
{
"input": [[12, 13, 14, 15]],
"output": [13]
},
{
"input": [[52, 77, 81, 97]],
"output": [97]
},
{
"input": [[120, 127, 131, 160]],
"output": [127, 131]
}
]
18 changes: 9 additions & 9 deletions pull-primes/meta.json → list_2_iterating/pull-primes/meta.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"title": "Pull Primes",
"name": "pull_primes",
"difficulty": "medium",
"author": "Julian",
"category": "List-2: Iterating",
"question_type": [
"coding"
]
{
"title": "Pull Primes",
"name": "pull_primes",
"difficulty": "medium",
"author": "Julian",
"category": "List-2: Iterating",
"question_type": [
"coding"
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading