What is the functionality of the following python code?
Import times
I = 0;
function a(k):
I+=k
time sleep(5)
Print i
function_a(1)
Answers
Answered by
0
No functionality. Error!
Explanation :
- The first reason is : Indentation is not followed. Interpreter raises an IndentError.
- Second reason : There is no library named times. It should be time.
- Third reason : I is defined before function call and is using it again locally, if you consider function_a(k) as function.
- Fourth reason, to create a function def keyword is must! It isn't used here.
- Fifth reason : In definition function_a(k) is written as function a(k) which isn't following the functionname rules.
- But, if you rectify every mistake, the functionality of this code is all about printing the digit 5 after waiting / sleeping for 5 seconds.
Learn more :
- Advantages of Programming in python
brainly.in/question/11007952
- Indentation is must in python. Know more about it at : brainly.in/question/17731168
Similar questions