Re: [BangPypers] Basic of basic question

2013-05-08 Thread jitendra gupta
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 On Tue, May 7, 2013 at 11:03 AM, Noufal Ibrahim nou...@nibrahim.net.inwrote: Umesh Tiptur umeshreloa...@yahoo.com

Re: [BangPypers] Basic of basic question

2013-05-08 Thread Noufal Ibrahim
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

Re: [BangPypers] Basic of basic question

2013-05-08 Thread Anand Chitipothu
In my 7+ years of Python programming I've never used the input/raw_input functions. People coming from C background look for a scanf replacement in Python, but that is now the way things are done in Python. You just write a function and call it at the end of the script and run it. Asking user for

Re: [BangPypers] Basic of basic question

2013-05-08 Thread Vaidik Kapoor
+1 The method explained by Noufal (using try except while trying to convert input string to int) should be the preferred way of doing what you intend to do. On May 8, 2013 5:18 PM, Noufal Ibrahim nou...@nibrahim.net.in wrote: jitendra gupta jitu.ic...@gmail.com writes: x = input(Enter the

[BangPypers] Hiring Python + Django - Developers for Hyderabad

2013-05-08 Thread Vinoth Jayaraman
Dear Professionals Greetings from Newt Global!!! ***We do have an urgent job opening for “Python Development” *** About Newtglobal: Newt Global is a global IT services and Product development Company headquartered in Irving, USA. Our offshore delivery center is based out of Chennai, India from

Re: [BangPypers] Basic of basic question

2013-05-08 Thread Mandar Vaze / मंदार वझे
On Wed, May 8, 2013 at 5:25 PM, Anand Chitipothu anandol...@gmail.com wrote: In my 7+ years of Python programming I've never used the input/raw_input functions. People coming from C background look for a scanf replacement in Python, but that is now the way things are done in Python. Yeah. I

Re: [BangPypers] Another qn. THanks for the basic of basic qn\

2013-05-08 Thread Jagadeesh N. Malakannavar
I prefer to do it like this a = list(str(3245325)) sum(map(int, a)) 24 -- Thanks, Jagadeesh N.Malakannavar ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers

Re: [BangPypers] Another qn. THanks for the basic of basic qn\

2013-05-08 Thread Gora Mohanty
On 8 May 2013 23:00, Jagadeesh N. Malakannavar mnjagade...@gmail.com wrote: I prefer to do it like this a = list(str(3245325)) sum(map(int, a)) 24 What does the map() gain you over basic list comprehension: sum( [int(i) for i in '3245325'] ) ignoring any try/catch for int conversion

Re: [BangPypers] Another qn. THanks for the basic of basic qn\

2013-05-08 Thread Noufal Ibrahim
Gora Mohanty g...@mimirtech.com writes: On 8 May 2013 23:00, Jagadeesh N. Malakannavar mnjagade...@gmail.com wrote: I prefer to do it like this a = list(str(3245325)) sum(map(int, a)) 24 What does the map() gain you over basic list comprehension: sum( [int(i) for i in '3245325'] )

[BangPypers] A Comparison of Mocking Frameworks

2013-05-08 Thread Sriram Narayanan
Hi everyone: A colleague pointed me to this comparison of mocking frameworks: http://garybernhardt.github.io/python-mock-comparison/ -- Sriram Belenix: www.belenix.org Twitter: @sriramnrn ___ BangPypers mailing list

Re: [BangPypers] Another qn. THanks for the basic of basic qn\

2013-05-08 Thread Gora Mohanty
On 9 May 2013 07:32, Noufal Ibrahim nou...@nibrahim.net.in wrote: Gora Mohanty g...@mimirtech.com writes: On 8 May 2013 23:00, Jagadeesh N. Malakannavar mnjagade...@gmail.com wrote: I prefer to do it like this a = list(str(3245325)) sum(map(int, a)) 24 What does the map() gain you over