- 1
The output of this code is 0
Any one answer plz Kasi Sireesha Next time add a link to the code and a bit more info about your problem here in the description, otherwise your question will be removed by the moderation team - Ace
5 ответов
+ 2
def func(x):
res=0
for i in range(x):
res+=i
return res
print(func(4))
Your indentation level are not proper. The above code is with proper indentation
+ 4
Which code?
+ 3
Kasi Sireesha there is no code here to help you... Please use the 8 rules for getting help from the community.
Thanks and happy coding.
https://www.sololearn.com/Blog/38/8-simple-rules-to-get-help-from-the-community
+ 2
Kasi Sireesha
res+=i
return res
so when function runs
0 is added to res and since return is in same line as res vataible , function stops executing and 0 is returned
0
https://code.sololearn.com/ca2TotiW0HpO/?ref=app
In the exceptions theory questions., the answer was given as 6.can u explain??