0

Print a list but the list couldn't print the repeated value?

like 2**1=2, 2**2=4, 2**3=8 .. 3**1=3, 3**2=9, 3**3=27 .. 4**1=4, 4**2=16, 4**3=64 .. the answers get stored in an array and print the answers but the repeated answers prints one time. Like 2**2=4 also 4**1=4 ... so it prints one time.

20th Nov 2018, 12:11 PM
Sohaib Ahmad Khan
Sohaib Ahmad Khan - avatar
3 Réponses
+ 3
Store the values in set structure. Set structure is and i quote "an unordered collection with no duplicate elements." -- Python documentation https://code.sololearn.com/cXQgpj292qnt/?ref=app
20th Nov 2018, 12:26 PM
Anya
Anya - avatar
+ 1
I updated my answer with some code.
20th Nov 2018, 12:39 PM
Anya
Anya - avatar
0
Sorry, need a code. I'm beginner.
20th Nov 2018, 12:29 PM
Sohaib Ahmad Khan
Sohaib Ahmad Khan - avatar