Skip to content

01/17/2024 class 1#1

Open
edaraa2 wants to merge 2 commits intomainfrom
01/17/2024-classwork
Open

01/17/2024 class 1#1
edaraa2 wants to merge 2 commits intomainfrom
01/17/2024-classwork

Conversation

@edaraa2
Copy link
Copy Markdown
Owner

@edaraa2 edaraa2 commented Feb 8, 2024

This file contains string operations encompasses fundamental concepts and methods essential for effective string manipulation in Python., including -Methods for iterating over strings
-Repetition and concatenation operators
-Strings as immutable objects
Repetition and concatenation operators are both used for manipulating strings in Python, but they serve different purposes:
Repetition Operator (*)
Function: Repeats a string a specified number of times.
-Slicing strings and testing strings
Slicing lets you grab specific parts of a string like picking from a slice of pie. You use square brackets with start and end positions to extract the portion you need.

Testing strings involves checking if a substring exists within another string. Imagine searching for a word in a sentence. Python's "in" operator acts like a detective, finding the presence (or absence) of the target word.
-String methods-
String methods are like tools in a text toolbox. They help you manipulate strings in Python. Slicing lets you cut out pieces, like taking a slice of bread. Concatenation joins strings, like building a sandwich. Iteration lets you loop through each letter, like examining each ingredient. Testing with "in" checks for words, like finding cheese on your sandwich. There are many more methods for searching, replacing, and formatting text, giving you ultimate control over your strings!
-Splitting a string - Splitting a string is like dividing a pizza into slices. You use the split() method with a separator (like a comma or space) to chop the string into a list of pieces. By default, it splits on whitespace, creating a list of words. You can customize the separator to target specific characters or patterns, allowing you to break the string down into exactly the pieces you need.

This file contains string operations encompasses fundamental concepts and methods essential for effective string manipulation in Python., including
-Methods for iterating over strings
-Repetition and concatenation operators
-Strings as immutable objects
-Slicing strings and testing strings
-String methods-
-Splitting a string
@edaraa2 edaraa2 self-assigned this Feb 8, 2024
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Comment thread ClassWork 01_17.ipynb
@@ -0,0 +1,360 @@
{
Copy link
Copy Markdown

@nikshepkulli nikshepkulli Feb 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No headers and detailed description.


Reply via ReviewNB

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Professor,

Added another file with requested comments under the name of ClassWork 01.ipynb

This file contains string operations encompasses fundamental concepts and methods essential for effective string manipulation in Python., including -Methods for iterating over strings
-Repetition and concatenation operators
-Strings as immutable objects
-Slicing strings and testing strings
-String methods-
-Splitting a string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants