If not declare return value, what type of return value is assumed? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

If not declare return value, what type of return value is assumed?

24th Apr 2018, 7:01 PM
ā˜…Aniket Mashilkarā˜…
ā˜…Aniket Mashilkarā˜… - avatar
2 Respostas
+ 1
Any function that does not explicitly declare a return type returns int.
25th Apr 2018, 4:29 AM
ā˜…Aniket Mashilkarā˜…
ā˜…Aniket Mashilkarā˜… - avatar
0
If a function in a statically typed language (C, C++, Java ect) has a return type (besides void) and returns nothing the compiler/interpreter will throw an error. In a dynamically typed one like Python normally the return value will be None or Null.
24th Apr 2018, 7:48 PM
TurtleShell
TurtleShell - avatar