Skip to content

Commit e148f94

Browse files
author
Amogh Singhal
authored
Update Python_Programming_Quiz.md
1 parent 95e7567 commit e148f94

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Python_Programming_Quiz.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,28 @@ break | else | from | None | print | with
5757
class | except | global | or | return | yield
5858
continue | exec | if | pass | raise |
5959

60+
#### 4. Which are some useful string methods in Python ? <br>
61+
Methods | Description |
62+
--- | --- |
63+
`tolower()` | Converts a string into lower case |
64+
`toupper()` | Converts a string into upper case |
65+
`swapcase()` | Swaps cases, lower case becomes upper case and vice versa |
66+
`islower()` | Returns True if all characters in the string are lower case |
67+
`isupper()` | Returns True if all characters in the string are upper case |
68+
`isalnum()` | Returns True if all characters in the string are alphanumeric
69+
|
70+
`isalpha()` | Returns True if all characters in the string are in the alphabet |
71+
`isnumeric()` | Returns True if all characters in the string are numeric |
72+
`capitalize()` | Converts the first character to upper case |
73+
`startswith()` | Returns true if the string starts with the specified value |
74+
`endswith()` | Returs true if the string ends with the specified value |
75+
`replace()` | Returns a string where a specified value is replaced with a specified value |
76+
`split()` | Splits the string at the specified separator, and returns a list |
77+
`splitlines()` | Splits the string at line breaks and returns a list |
78+
`join()` | Joins the elements of an iterable to the end of the string |
79+
`strip()` | Returns a trim version of the string |
80+
`lstrip()` | Returns a left trim version of the string |
81+
`rstrip()` | Returns a right trim version of the string |
82+
`count()` | Returns the number of times a specified value occurs in a string |
83+
`find()` | Searches the string for a specified value and returns the position of where it was found |
84+

0 commit comments

Comments
 (0)