1 00:00:07,840 --> 00:00:13,720 So until now, what we are doing quite simply, to run a function and then see some text on our screens, 2 00:00:14,080 --> 00:00:22,420 but in the real world, the functions are basically used to get certain inputs and providers to certain 3 00:00:22,420 --> 00:00:23,080 outputs. 4 00:00:23,260 --> 00:00:27,130 And when we're putting the statements, we are not actually getting any output. 5 00:00:27,140 --> 00:00:31,460 We are just seeing text that was presented to the parenticide, the function. 6 00:00:31,720 --> 00:00:37,630 So in order to get an actual output, in order to function, to give us some variable, we use the return 7 00:00:37,630 --> 00:00:40,990 statement and I will show you why we actually use it. 8 00:00:41,290 --> 00:00:49,150 So let's imagine that we need to create a function that estimates about having the velocity and the 9 00:00:49,150 --> 00:00:52,720 time so the parties equal to the goals to multiply by the time. 10 00:00:52,960 --> 00:00:55,780 And this is what the function is going to estimate. 11 00:00:56,020 --> 00:00:57,430 So let's write to Jeff. 12 00:00:57,880 --> 00:01:06,520 But the committee, so we're passing a velocity and the time to just function, then print. 13 00:01:07,150 --> 00:01:09,220 And as you can see, this is our function. 14 00:01:09,220 --> 00:01:13,780 And without we don't have a return statement here for that reason. 15 00:01:14,230 --> 00:01:21,030 Let's right now is Suko and let's pause about 30 and 60. 16 00:01:21,340 --> 00:01:27,130 So we have the speed of 30 kilometers per hour and our time is 60 hours. 17 00:01:28,120 --> 00:01:29,550 And now let's print this. 18 00:01:29,560 --> 00:01:34,250 So print s so let's run the court and see what happens. 19 00:01:34,990 --> 00:01:41,560 Now, what you're getting here is the value that you needed and also you are getting. 20 00:01:41,560 --> 00:01:43,450 No, but what you're getting. 21 00:01:44,500 --> 00:01:51,070 Well, this is because you're first calling the print statement inside the function and then you're 22 00:01:51,070 --> 00:01:52,960 actually trying to print the value of this. 23 00:01:53,240 --> 00:01:57,350 That's why first you're getting the right result and then you're getting no. 24 00:01:57,850 --> 00:02:03,850 And this is because and can be simply avoided by adding a written statement and that function. 25 00:02:04,240 --> 00:02:10,750 So what you can do instead of printing everything, is the function is to return it to our right return. 26 00:02:11,140 --> 00:02:13,080 We multiply it by T. 27 00:02:14,640 --> 00:02:21,120 And then instead of having a sequel to that statement, you can see right inside the print statement 28 00:02:21,270 --> 00:02:27,490 the name of the function sockpuppet and pass the virus 30 and 60. 29 00:02:27,750 --> 00:02:31,700 So now if you're on the court, you're getting simply the result. 30 00:02:31,710 --> 00:02:34,960 And this is because you're printing the result on here. 31 00:02:35,250 --> 00:02:40,260 So when you run the function, you're returning the value of your multiplied by 80. 32 00:02:40,280 --> 00:02:41,850 This is the output of the function. 33 00:02:41,970 --> 00:02:45,000 And then you're printing this result with the print statement here.