0

can somebody tell me the error in this code?

the real question is why when there is one missing argument that we dont need in the function the function dont work here is the code : the function didint need that input (i forgot if its vv or v2) https://code.sololearn.com/coCHmlUr47X3

6th Aug 2019, 4:37 PM
Abdelhakim Cube Emp Gu Ayed
Abdelhakim Cube Emp Gu Ayed - avatar
3 Réponses
+ 2
You can declare it as optional => *v2, so even without it the function will work.
6th Aug 2019, 4:44 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 1
Hey Abdelhakim Cube Emp Gu Ayed . If you call test using three input arguments, then it works. If you don't need the third one necessarily, give it a default value just like the remaining once already there (probably a = float('nan'), since a == a will return false). a is used just as an example. Hope this helps. Cheers. C
6th Aug 2019, 4:50 PM
ChrA
ChrA - avatar
+ 1
This is the same as trying to add two numbers up without knowing one of them. It's simply impossible and returns an error (unless you have default values).
6th Aug 2019, 4:50 PM
Diego
Diego - avatar