6084/delete-a-character-from-pythons-string
new_word = old_word.replace("c", "")
Use replace() as shown
If you want to remove the 'J' wherever it appears:
newstr = oldstr.replace("J", "")
For central character removal :
midlen = len(oldstr)/2 newstr = oldstr[:midlen] + oldstr[midlen+1:]
Hope this helps you.
You can use word.find('o') as well to ...READ MORE
class Solution: def firstAlphabet(self, s): self.s=s k='' k=k+s[0] for i in range(len(s)): if ...READ MORE
Python strings are immutable, you change them ...READ MORE
You can use the code below: lis = ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
You can simply the built-in function in ...READ MORE
You can remove the substring using slicing. ...READ MORE
Use iter(): element = next(iter(set_1)) READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.