Anyone can tell me how I got the output is 8 | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Anyone can tell me how I got the output is 8

fib = {2:1, 2:1, 3:2, 4:3} Print(fib.get(4,0) + fib.get(7,5)

10th Aug 2020, 10:45 AM
Sagar Kumar
Sagar Kumar - avatar
5 ответов
+ 4
Sorry no idea then ,maybe there is a dictionary din with key value pair of 4:3 which returns 3 and a dictionary fib with key value pair of something else(not 7 as key) but fib.get(7,5) returns the value 5 in case key is not there in dictionary ,then only you can get a output of 8!
10th Aug 2020, 10:57 AM
Abhay
Abhay - avatar
+ 2
Sorry that was my mistake ,now check again
10th Aug 2020, 11:00 AM
Sagar Kumar
Sagar Kumar - avatar
+ 2
Thanks a ton bro
10th Aug 2020, 11:02 AM
Sagar Kumar
Sagar Kumar - avatar
+ 1
Is this the full code?
10th Aug 2020, 10:51 AM
Abhay
Abhay - avatar
+ 1
Yes
10th Aug 2020, 10:53 AM
Sagar Kumar
Sagar Kumar - avatar