If not declare return value, what type of return value is assumed? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 Answers
+ 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