en(list_of_lists1)):
tt = list_of_lists1[index]
print 'Current value :', tt
avg =average (tt)
This gives an error:
def average(s): return sum(s) * 1.0 / len(s)
TypeError: unsupported operand type(s) for +: 'int' and 'str'
I also attach the file i am re
for i in range(len(number_list)):
if number_list[i] > 5:
s_data = number_list[i]
print 'Data val:', s_data
The problem is: it is printing only the last value, not all the values. In
this case '10', not '9,8,6,10'.
Regards,
Arijit Ukil
Tata
range(math.floor(float(len(number_list)/2))):
if (k< math.floor(float(len(number_list)/2))):
number_list_1[k] = number_list[k*2 + 1]
print 'data: ', number_list_1
Please help
Regards,
Arijit Ukil
Tata Consultancy Services
Mailto: arijit.u...@tcs.com
Website: http:
tafile = f.readlines()
list_of_lists = datafile
for data in list_of_lists:
lstval = data.split (',')
timest = float(lstval[0])
energy = float(lstval[1])
f.close()
print timest
Regards,
Arijit Ukil
Tata Consultancy Services
Mailto: arijit.u...@tcs.c
val = avrg(data)
out = pow(val,2)
return out
Pls help.
Regards,
Arijit Ukil
Tata Consultancy Services
Mailto: arijit.u...@tcs.com
Website: http://www.tcs.com
Experience certainty. IT Services
Business
:
val = avrg(data)
out = pow(val,2)
return out
I am using python 2.6. My intention is to run from windows command prompt
as
python my_python.py 1 3 2
However I am getting error: No such file in the directory, Errno 21
Pls help.
Regards,
Arijit Ukil
Tata Consultancy Servi
:])
When running in command line I am getting these errors:
In case 1. data = sys.argv[1]
In case 2, data = float(sys.argv[1])
In case 3, data = int (sys.argv[1])
Regards,
Arijit Ukil
Tata Consultancy Services
Mailto: arijit.u...@tcs.com
Website
I like to implement sha-256 without using implement. It is easy using
hashlib as:
import hashlib
m = hashlib.sha256()
m.update("hi")
print m.hexdigest()
If anybody has pointer on sha-256 implemented without using hashlib
library, please share.
Regards,
Arijit Ukil
Tata Consultanc
i am writing following python function:
def my_func (arg1, arg2, arg3):
however, I am not always going to pass all the arguments. sometimes only
arg1 is passed, sometimes arg1 and arg2 are passed; sometimes arg1, arg2,
arg3 are passed.
How can i manage this?
Regards,
Arijit Ukil
Tata
() returns 45 at the first call, x should retain 45 even in
multiple calls.
Pls help.
Regards,
Arijit Ukil
Tata Consultancy Services
Mailto: arijit.u...@tcs.com
Website: http://www.tcs.com
Experience certainty. IT Services
Business
10 matches
Mail list logo