Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix(curriculum): description improvement case converter program #54051
base: main
Are you sure you want to change the base?
fix(curriculum): description improvement case converter program #54051
Changes from 18 commits
d35ce8d
60dce15
873b86b
c6396b8
b7e83da
b7aefe4
c64f2a0
4980daf
aec1314
514c747
406a7d6
edccf76
531d952
f0b6ab9
059e182
065c9cb
ca43574
60f975b
4947e82
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Let's use AST tests when we are creating new ones, it allows any equivalent code, irrespective of spaces and quotes used and stuff.
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.
--description--
List comprehensions accept conditional statements, to evaluate the provided expression only if certain condition are met:
As you can see from the output, the list of characters generated from
pascal_or_camel_cased_string
has been joined. Since the expression inside the list comprehension is evaluated for each character, the result is a lowercase string with all the characters separated by an underscore.Follow the example above to add an
if
clause to your list comprehension so that the expression is executed only if the character is uppercase.--hints--
You should add and
if
clause with the conditionchar.isupper()
to your list comprehension.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.
We can consider to add another test to check the existing part of the comprehension.
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.
This test passes on the seed code.