I need help understanding a statement | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I need help understanding a statement

primes = {1: 2, 2: 3, 4: 7, 7:17} print(primes[primes[4]]) I am unsure why in "print(primes[primes[4]])" primes is called twice. Any help is appreciated

19th Jun 2019, 7:48 AM
Jacob Randall
Jacob Randall - avatar
1 Answer
+ 3
Because prime[4] is 7 , prime[prime[4]] = prime[7] prime[7] = 17.
19th Jun 2019, 8:08 AM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar