Dec-03-2019, 10:53 AM
I use this code and it generates numbers in the list, but I would also like it create this name along with it for the list name.
This is the name I hoping for:
lst1z
So here is my code Thanks:
This is the name I hoping for:
lst1z
So here is my code Thanks:
composites=[] n = int(input("Enter any number : ")) positive_n = abs(n) for num in range(positive_n+1): if num > 1: for i in range(1, num,1): if (num % i) == 0: if n > 0: composites.append(num) else: composites.append(-num) break print ("\ncomposites from", int(positive_n / n), " to ", n, "\n", composites)