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 1 year 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 1 year ago by codeadmin (110,730 points)

Related questions

–2 votes
2 answers
posted 10 months ago in Python by joonas.hasanen (660 points)
+6 votes
1 answer
0 votes
1 answer
posted 10 months ago in SQL by SUNRISER (1,960 points)
+2 votes
1 answer
posted 8 months ago in Python by dr.emad.adnan (560 points)