Closed gurukiran07 closed 4 years ago
I'm adding one more question which has a daily use. 1. Sum of elements in lists of arbitrary number.
input=[1,2,3,4,5],[4,2,6,2,3],[1,9,1,5,2]
#any number of lists can be passed as arguments SumOfLists([1,2,3,4,5],[4,2,6,2,3],[1,9,1,5,2])
output=[6,13,10,11,10]
Hi @gurukiran07 I would like to work on this issue as a part of hacktoberfest. Could you please assign this to me?
Hi, @gurukiran07 I would be glad to help you with this pr as part of the hacktoberfest month Can you assigned me in? 😄
Thanks for taking the time to compile this list. However, some of these are not worth adding (as they are either built-ins or very simple) and others have already been added in the meantime.
I put together a list of questions which I believe are useful. Some of them may have been already covered in the snippets.
Python questions frequently asked on SO:
1. Round to a base value
Example:
2. Check if a string contains a given sub-string
Example:
3. Sorted a dictionary by key or value
Example:
4. Selecting a random element from a given sequence
Example:
5. Join a sequence with a given delimiter
Example:
6. Determine the type of a variable
Example:
7. Pad a string with given value to make it a specific length
Example:
8. Convert two lists into a dictionary
Example:
9. Trim whitespace from a string.
Example:
10. Determine if an object is iterable
Example:
11. Return multiple values
This question has two answers, 1 return a list of all possible outputs. 2 Using
yield
, a generator function. IMO, we don't have any snippets related toyield
. We can introduce one of the Python's core functionality usingyield
12. Check if a value is NaN
Example:
13. Return ASCII value of a character and vice-versa.
Example:
14. Remove duplicate from a list whilst preserving the order
Using
set
doesn't gaurentee the order of the list. Example:15. Efficient way to remove unordered duplicates
Example:
This list is not exhaustive as of now. I can add more to the list over time. I don't if questions related to files, directories, os, datetime are relevant to this repo. If yes, I can add them too.