Forums

Error on type(some_str)

I'm gonna kick myself when someone answers ... but 30 minutes and I cant figure this out I'm new to Python 3 ... is this different??? Or maybe I've gone nuts

What is the syntax error in:

url = "http://www.google.com"
print type(url)

enter image description here

In python 3, the print statement is slightly changed. To print something, it needs to be in parenthesis (its pretty stupid i know...).

In your case, try:

print(type(url))

Hope this helps! :)

"The key differences between Python 2.7.x and Python 3.x with examples":

http://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html

HTH

Jim

lol thanks y'all!!