jitendra gupta <jitu.ic...@gmail.com> writes: >>>> x = input("Enter the nu\t") > Enter the nu 3 >>>> type(x) > <type 'int'> >>>> x = input("Enter the STR\t") > Enter the STR "3" >>>> type(x) > <type 'str'> >>>> > > Use input(), this will take care of your data type
input is the equivalent of eval(raw_input()). So you get funny things like this >>> input() os.listdir("/") ['sbin', 'dev', 'mnt', 'etc', 'lost+found', '.ure', '.pulse', 'proc', 'sys', 'home', 'media', 'lib64', 'lib', 'opt', 'usr', 'vmlinuz.old', 'initrd.img', 'lib32', 'tmp', 'run', 'vmlinuz', 'srv', '.pulse-cookie', 'bin', 'petabox', 'selinux', 'root', 'var', 'initrd.img.old', 'boot'] Not the smartest of things to do. [...] -- Cordially, Noufal http://nibrahim.net.in _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers