Answers for "get string in brackets python"

0

get string in brackets python

s = "alpha.Customer[cus_Y4o9qMEZAugtnW] ..."
m = re.search(r"\[([A-Za-z0-9_]+)\]", s)
print m.group(1)

> cus_Y4o9qMEZAugtnW
Posted by: Guest on October-01-2020
0

return returns string with brackets python

Instead of: return ("Temperature in Fahrenheit Shall Be: ", far)
You need to turn your variable to a string and then use the + operator:
return "Temperature in Fahrenheit Shall Be: " + str(far)

Source: https://stackoverflow.com/questions/55490290/python-return-statement-includes-brackets
Posted by: Guest on July-06-2021

Code answers related to "get string in brackets python"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language