Home > Software engineering >  How can we remove first element and spaces between them in a string in python?
How can we remove first element and spaces between them in a string in python?

Time:08-06

How can I remove first element and all spaces in this string?

url = '1    https://coinmarketcap.com/historical/20220109/'

CodePudding user response:

Your problem has solved

url = '1    https://coinmarketcap.com/historical/20220109/'
print(url)
print(url[1:].strip())

#assign to another variable if need 
new_url = url[1:].strip()

print(new_url)
  • Related