Functions Type() I


#1

Can someone explain to me my this isn't printing? It keeps saying syntax error ' File "python", line 7
*
^
SyntaxError: invalid syntax

This is my code:

print type(27)
print type(0.0000001)
print type("Aliens exsist")



Thank you in advanced.


#2

you test it on your pc or on this site?

if you test on this site:
refresh the page and test again.
and test print with () --> print(type(27))
this style of print command is work for python 2 and 3, but, print "somethings" is just for python 2.

if you test this code on your pc:
just check print() may be your python is on version 3.

else:
that say at line 7, but your code have 3 lines, no more. if you have more code in file insert that in here for check.

( this is if...else help :smiley: :wink: )


#5

For some reason it won't let me input the rest on to the forum. The exercise is Functions exercise 16 Type()
I don't understand my problem because the code that wrong is the default code below the ones I sent you, which doesn't make any sense.

Thanks in advanced
Here is a screenshot of the rest
https://gyazo.com/d9a9bf831a62dba6c0e7757a3caadc16


#6

you must, just code in python, output will show in the right window.
you 7,8,9 line is not a python code. you must delete that, then test again.(you will see this lines in output box(terminal or right window)


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.