type(x) syntax in a test

Bellamy Bruno bellamy at freesurf.fr
Wed Aug 23 05:53:52 EDT 2000


Hi there...

I guess my mistake is a typical beginner's one, sorry...
But I just can't find the right syntax to make a test on a type.

For instance:

a = 'hello world'
if type(a) == 'string':
	print 'glad to meet you'

doesn't work...

I surely missed something, but so far I can't find out what...



More information about the Python-list mailing list