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
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
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
+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
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
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
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
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
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'] )
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
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
11 matches
Mail list logo