Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix exercise 3 on strings. #97

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

Merged
merged 2 commits into from
Apr 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions 15 basic_datatypes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2201,6 +2201,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -2214,7 +2215,7 @@
"* `string.endswith(suffix, start, end)` - returns `True` if the string ends with the suffix, `False` otherwise\n",
"* `string.find(substring, start, end)` - returns the lowest index in the string where substring is found, or `-1` if not found\n",
"* `string.replace(old, new, number)` - returns a copy of the string with `number` occurrences of old replaced by new. If `number` is omitted, all occurrences are replaced\n",
"* `string.split(separator, maxsplit)` - returns a list of the words in the string, using separator as the delimiter string. If `maxsplit` is given, at most `maxsplit` splits are done\n",
"* `string.split(separator, maxsplit)` - returns a list of the words in the string, using a separator as the delimiter string. If `maxsplit` is given, at most `maxsplit` splits are done. If `separator` is not provided, the string will be split on any whitespace character.\n",
"* `string.join(iterable)` - returns a string consisting of the strings in the iterable joined by the string on which the method is called\n",
"* `string.splitlines(keepends)` - returns a list of the lines in the string, breaking at line boundaries. If `keepends` is `True`, the line breaks are included in the resulting list\n",
"* `string.isalnum()` - returns `True` if the string consists of alphanumeric characters, `False` otherwise\n",
Expand All @@ -2234,11 +2235,11 @@
"source": [
"## Exercises on strings\n",
"\n",
"1. Write a program that recieves a string as input and returns a copy of the string with the first character capitalized and the rest lowercased.\n",
"2. Write a program that recieves a string as input and returns a copy of the string with all the characters lowercased.\n",
"3. Write a program that recieves a string with several words separated by spaces as input and returns a list of the words in the string.\n",
"4. Write a program that recieves a list of words as input and returns a string consisting of the words in the list separated by commas.\n",
"5. Write a program that recieves a string as input and returns a list of the lines in the string, breaking at line boundaries."
"1. Write a program that receives a string as input and returns a copy of the string with the first character capitalized and the rest lowercased.\n",
"2. Write a program that receives a string as input and returns a copy of the string with all the characters lowercased.\n",
"3. Write a program that receives a string with several words separated by any whitespace character (space, new line, Tab, etc.) as input and returns a list of the words in the string.\n",
"4. Write a program that receives a list of words as input and returns a string consisting of the words in the list separated by commas.\n",
"5. Write a program that receives a string as input and returns a list of the lines in the string, breaking at line boundaries."
]
},
{
Expand Down Expand Up @@ -2736,7 +2737,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.1"
"version": "3.9.6"
},
"vscode": {
"interpreter": {
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.