Apr-23-2019, 07:29 PM
def nb_dig(n,d): r = [n**2 for n in range(1,n)] digz = [d for d in r] print(r,digz) nb_dig(10,1)
Output:>>>[1, 4, 9, 16, 25, 36, 49, 64, 81] [1, 4, 9, 16, 25, 36, 49, 64, 81]
So, I want 'd' to be a string value, telling me how many times certain number occurs in the results, but instead of it I get some bs. Why the damn 'd' in digz is not imported from the function parameters?