all AI news
Understanding Strings - Python
March 29, 2024, 3:52 p.m. | Sakshi
DEV Community dev.to
Good day guys,
Python Unleash'd 05
I always wished someone taught me strings along with all its methods and behaviors, there are some exceptions where things become complex. Lets see all applicable methods on strings one by one.
Here we see empty string with nothing, empty string with space
print("first")
empty_string = ""
print(empty_string, len(empty_string))
print("second")
string_with_space = " "
print(string_with_space, len(string_with_space))
print("third")
And the output is :
String with one space has length 1 while without space has 0 …
become beginners exceptions good nothing programming python space string strings understanding
More from dev.to / DEV Community
Jobs in AI, ML, Big Data
Lead Developer (AI)
@ Cere Network | San Francisco, US
Research Engineer
@ Allora Labs | Remote
Ecosystem Manager
@ Allora Labs | Remote
Founding AI Engineer, Agents
@ Occam AI | New York
AI Engineer Intern, Agents
@ Occam AI | US
AI Research Scientist
@ Vara | Berlin, Germany and Remote