More elegant way to check if a string is empty Read here Read here
if not s_string:
sys.exit()
You don't need a sys.exit(), just let the program exit on its own.
if s_string:
print(s_string)
# the program will exit here anyway.
sys.exit()
has some side-effects like killing the python interpreter, which might have some undesirable effects. Read here Read here
You don't even need to check if the string is empty
print(s_string) # If string is empty, will print nothing except for a newline.
Name s_string
just s
or string
.
It doesn't detract from the readability of the code, and makes it more pretty and easier to type(and read)
Most people tend to prefer double quotes "
for string literals Read Here Read Here
More elegant way to check if a string is empty Read here
if not s_string:
sys.exit()
You don't need a sys.exit(), just let the program exit on its own.
if s_string:
print(s_string)
# the program will exit here anyway.
sys.exit()
has some side-effects like killing the python interpreter, which might have some undesirable effects. Read here
You don't even need to check if the string is empty
print(s_string) # If string is empty, will print nothing except for a newline.
Name s_string
just s
or string
.
It doesn't detract from the readability of the code, and makes it more pretty and easier to type(and read)
Most people tend to prefer double quotes "
for string literals Read Here
More elegant way to check if a string is empty Read here
if not s_string:
sys.exit()
You don't need a sys.exit(), just let the program exit on its own.
if s_string:
print(s_string)
# the program will exit here anyway.
sys.exit()
has some side-effects like killing the python interpreter, which might have some undesirable effects. Read here
You don't even need to check if the string is empty
print(s_string) # If string is empty, will print nothing except for a newline.
Name s_string
just s
or string
.
It doesn't detract from the readability of the code, and makes it more pretty and easier to type(and read)
Most people tend to prefer double quotes "
for string literals Read Here
More elegant way to check if a string is empty Read here
if not s_string:
sys.exit()
You don't need a sys.exit(), just let the program exit on its own.
if s_string:
print(s_string)
# the program will exit here anyway.
sys.exit()
has some side-effects like killing the python interpreter, which might have some undesirable effects. Read here
You don't even need to check if the string is empty
print(s_string) # If string is empty, will print nothing anyway.except for a newline.
Name s_string
just s
or string
.
It doesn't detract from the readability of the code, and makes it more pretty and easier to type(and read)
Most people tend to prefer double quotes "
for string literals Read Here
More elegant way to check if a string is empty Read here
if not s_string:
sys.exit()
You don't need a sys.exit(), just let the program exit on its own.
if s_string:
print(s_string)
# the program will exit here anyway.
sys.exit()
has some side-effects like killing the python interpreter, which might have some undesirable effects. Read here
You don't even need to check if the string is empty
print(s_string) # If string is empty, will print nothing anyway.
Name s_string
just s
or string
.
It doesn't detract from the readability of the code, and makes it more pretty and easier to type(and read)
Most people tend to prefer double quotes "
for string literals Read Here
More elegant way to check if a string is empty Read here
if not s_string:
sys.exit()
You don't need a sys.exit(), just let the program exit on its own.
if s_string:
print(s_string)
# the program will exit here anyway.
sys.exit()
has some side-effects like killing the python interpreter, which might have some undesirable effects. Read here
You don't even need to check if the string is empty
print(s_string) # If string is empty, will print nothing except for a newline.
Name s_string
just s
or string
.
It doesn't detract from the readability of the code, and makes it more pretty and easier to type(and read)
Most people tend to prefer double quotes "
for string literals Read Here
More elegant way to check if a string is empty Read here
if not s_string:
sys.exit()
You don't need a sys.exit(), just let the program exit on its own.
if s_string:
print(s_string)
# the program will exit here anyway.
sys.exit()
has some side-effects like killing the python interpreter, which might have some undesirable effects. Read here
You don't even need to check if the string is empty
print(s_string) # If string is empty, will print nothing anyway.
Name s_string
just s
or string
.
It doesn't detract from the readability of the code, and makes it more pretty and easier to type(and read)
Most people tend to prefer double quotes "
for string literals Read Here