Added swap case program and removed unexpected expression part - #3212
Conversation
| 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.
I was getting error in pycharm 'unexpected expression part' before running a program.
There was a problem hiding this comment.
I have fixed it again and I have commited changes. Sorry for the inconvenience
| 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.
I was getting error in pycharm 'unexpected expression part' before running a program.
There was a problem hiding this comment.
Pycharm is not upgraded to Python 3.8 and 3.9 which support this functionality.
| """ | ||
| if len(sentence) < 1001: | ||
| newstring = '' | ||
| for word in sentence: |
There was a problem hiding this comment.
These are not words. They are char.
There was a problem hiding this comment.
I have fixed it and commit the changes
| else: | ||
| raise Exception("Charater length should be between 1 and 1000") |
There was a problem hiding this comment.
I have raise an exception and its readable. If its not relatable should I remove it?
There was a problem hiding this comment.
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.
I have removed condition
| 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.
| >>>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.
I have added space. I have commited changes
| 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.
Its example for problem statement. If someone failed to understand the problem. This example is self explanatory
There was a problem hiding this comment.
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.
Ok. I will fix it.
There was a problem hiding this comment.
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 |
…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}.