Welcome to Interactive Programming Forums, where you can ask questions, receive answers from other members of the community, post code snippets and post exercies.

Python Code Error

+4 votes
Copy paste from lesson but code does not work???

url = "http://ipv6.he.net"
if search (r' (http://)?([a-z|0-9]') ?he\.net', url):
print "Pattern matched!"

HELP!
posted 12 years ago in Python by Manuel Pacheco (1,280 points)

1 Answer

0 votes
Hi,

If statement requires an indentation as below:

url = "http://ipv6.he.net"
if search (r' (http://)?([a-z|0-9]') ?he\.net', url):
   print "Pattern matched!"

Please retest.
answered 12 years ago by codeadmin (113,880 points)

Related questions

–2 votes
2 answers
posted 12 years ago in Python by joonas.hasanen (660 points)
+7 votes
1 answer
–1 vote
1 answer
posted 12 years ago in SQL by SUNRISER (2,050 points)
+1 vote
1 answer
posted 12 years ago in Python by dr.emad.adnan (570 points)