No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
| |
How can we in python change the number of elements in a line to the next, this is, for example... We have the following txt file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 And we want a program which the output … | |
I´m a begginer in java and i would like to know how can i create graphs like: y=ax+b for example thanks | |
Can anybody tell me how can i avoid the overflow of this program? from math import sqrt f=lambda n: sum([int(i)*int(i) for i in str(n)]) L=[] for n in range(0,10**20): if sqrt(f(n))%1==0:# == float(int(sqrt(f(n)))): L.append(n) L.sort() print "Número de quadrados perfeitos na lista:",len(L) print L y= lambda L: reduce(lambda x,y: x+y,L) … | |
does anybody knows why this function doesn´t work very well: f=lambda n: reduce(lambda x,y:x**2+y**2, map(int,str(n))) I want that this function add the square of the digits of a number an example of what i want: f(442)=4**2+4**2+2**2=36 and it's giving me f(442)=1028!!!:S However fou numbers with 2 digits the function works! |