-
-
Notifications
You must be signed in to change notification settings - Fork 46.4k
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
Added swap case program and removed unexpected expression part #3212
Conversation
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: f141dbc0-0c0f-11eb-a59b-f3f3774a9991 |
sorts/cocktail_shaker_sort.py
Outdated
@@ -42,4 +42,4 @@ def cocktail_shaker_sort(unsorted: list) -> list: | |||
doctest.testmod() | |||
user_input = input("Enter numbers separated by a comma:\n").strip() | |||
unsorted = [int(item) for item in user_input.split(",")] | |||
print(f"{cocktail_shaker_sort(unsorted) = }") | |||
print(f"{cocktail_shaker_sort(unsorted) }") |
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.
Why break 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.
I was getting error in pycharm 'unexpected expression part' before running a program.
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 fixed it again and I have commited changes. Sorry for the inconvenience
strings/naive_string_search.py
Outdated
@@ -39,4 +39,4 @@ def naive_pattern_search(s: str, pattern: str) -> list: | |||
|
|||
if __name__ == "__main__": | |||
assert naive_pattern_search("ABCDEFG", "DE") == [3] | |||
print(f"{naive_pattern_search('ABAAABCDBBABCDDEBCABC', 'ABC') = }") | |||
print(f"{naive_pattern_search('ABAAABCDBBABCDDEBCABC', 'ABC')}") |
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.
Why break 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.
I was getting error in pycharm 'unexpected expression part' before running a program.
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.
Pycharm is not upgraded to Python 3.8 and 3.9 which support this functionality.
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 fixed this
strings/swap_case.py
Outdated
""" | ||
if len(sentence) < 1001: | ||
newstring = '' | ||
for word in sentence: |
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.
These are not words. They are char.
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.
ok. I will fix it
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 fixed it and commit the changes
strings/swap_case.py
Outdated
else: | ||
raise Exception("Charater length should be between 1 and 1000") |
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.
Why?
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 raise an exception and its readable. If its not relatable should I remove it?
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.
No. I mean why create a 1000 character limit? Just process the string no matter how long it is.
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 removed condition
strings/swap_case.py
Outdated
def swap_case(sentence): | ||
""" | ||
This function will convert all lowercase letters to uppercase letters and vice versa. | ||
>>>swap_case('Algorithm.Python@89') |
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.
>>>swap_case('Algorithm.Python@89') | |
>>> swap_case('Algorithm.Python@89') |
Without the space, the test is never run.
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 will fix it
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 added space. I have commited changes
strings/swap_case.py
Outdated
2)>>>Please input sentence: github.com/mayur200 | ||
GITHUB.COM/MAYUR200 | ||
|
||
Constraints: Length of string should between 1 and 1000 |
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.
Why?
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.
Its example for problem statement. If someone failed to understand the problem. This example is self explanatory
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.
No. I mean why create a 1000 character limit? Just process the string no matter how long it is.
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.
Ok. I will fix it.
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 fixed it and I have pushed changes
All tests are failing. |
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: 1e9101f0-0e59-11eb-964d-5d54b4986782 |
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: 7a45e010-0e59-11eb-964d-5d54b4986782 |
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: 790c3220-0e5a-11eb-964d-5d54b4986782 |
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: 0603d7a0-0e5b-11eb-964d-5d54b4986782 |
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: 4eda6340-0e5b-11eb-964d-5d54b4986782 |
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: bff9e410-0e5b-11eb-964d-5d54b4986782 |
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: 9ed5bd80-0e5c-11eb-964d-5d54b4986782 |
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: 913ca430-0e5d-11eb-964d-5d54b4986782 |
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: 8be5a5d0-0e5e-11eb-964d-5d54b4986782 |
Why my test is failed again?? |
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: cc658370-0e66-11eb-964d-5d54b4986782 |
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: df9cfd00-0e67-11eb-964d-5d54b4986782 |
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: 4faa06f0-0e69-11eb-964d-5d54b4986782 |
Travis tests have failedHey @mayur200, TravisBuddy Request Identifier: 08950c00-0e6a-11eb-964d-5d54b4986782 |
…gorithms#3212) * Removed an extra '=' which was creating an error while running a program. * Removed the unexpected expression part. * Added program for swap cases in string folder * removed if condition and exchange word with char * added '=' sign which I removed before because of unknowing error from pycharm * added space in test * removed costraint from problem statement * Update cocktail_shaker_sort.py * Update naive_string_search.py * Update swap_case.py * psf/black " not ' * added new line at the end of the file * Fix flake8 issues * added new line at the end of the file * added True and fixed comment * python file end with \n * Update swap_case.py * Update strings/swap_case.py * Update strings/swap_case.py * Apply suggestions from code review * Update strings/swap_case.py * Update swap_case.py * Update swap_case.py Co-authored-by: Christian Clauss <cclauss@me.com>
…gorithms#3212) * Removed an extra '=' which was creating an error while running a program. * Removed the unexpected expression part. * Added program for swap cases in string folder * removed if condition and exchange word with char * added '=' sign which I removed before because of unknowing error from pycharm * added space in test * removed costraint from problem statement * Update cocktail_shaker_sort.py * Update naive_string_search.py * Update swap_case.py * psf/black " not ' * added new line at the end of the file * Fix flake8 issues * added new line at the end of the file * added True and fixed comment * python file end with \n * Update swap_case.py * Update strings/swap_case.py * Update strings/swap_case.py * Apply suggestions from code review * Update strings/swap_case.py * Update swap_case.py * Update swap_case.py Co-authored-by: Christian Clauss <cclauss@me.com>
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.