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
3 Réponses
+ 2
You can declare it as optional => *v2, so even without it the function will work.
+ 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
+ 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).