February 4th, 2013, 09:45 AM
String and regexp
I am very new to python and have a simple task -
Given a string "0x8bb860" I need to determine if if starts with the characters "0x"
I have tried
x = "0x8bb860
but this gives me an exception
How is the correct way to do this?
February 4th, 2013, 10:13 AM
Add the ending double quote and, if you are using Python 3, use parentheses:
Originally Posted by grahamlabdon
x = "0x8bb860"
My armada: openSUSE 13.1 (home desktop, home laptop), Crunchbang Linux 11 (work laptop), Trisquel GNU/Linux 6.0.1 (mini laptop), Ubuntu 14.04 LTS (server), Android 4.2.1 (tablet), Windows 7 Ultimate (testbed)
February 4th, 2013, 10:14 AM