Courses
Courses
Code Compiler
Code Compiler
Discuss
Pricing
Teams
Log in
Register
Menu
Q&A Discussions
Search
Search
Ask a question
Ask a question
what is the output of def func(x): res = 0 for i in range(x): res += i return res print(func(4))?
python
-11 Votes
17 Answers
7th Jun 2018, 2:21 PM
Saurav nalla
I don't understand, why result is 6 def func(x): res=0 for i in range(x): res+= i return res print (func (4))
python
3 Votes
16 Answers
8th Sep 2016, 12:47 PM
Giorgi
def func(x): res = 0 for i in range(x): res += i return res print(func(7))
function-arguments
modules
0 Votes
2 Answers
12th Aug 2020, 7:46 AM
Shubham Kumar
Function output
def
func(a)
func(x):
print(a)
x=1
0 Votes
5 Answers
12th Feb 2020, 8:35 PM
Sinan
explanation plzzzz!!!
+=
=
0
def
for
func(x):
i
in
range(x):
res
0 Votes
2 Answers
20th Mar 2019, 8:48 AM
Azfar
Ask a question
Ask a question
Ask a question
Ask a question
Hot today
How can a recursive function works perfectly in a for loop with large numbers while calling it too many times raises an error?
3 Votes
How to allow one instance of exe
1 Votes
Reverse observer pattern : remove dynamic_cast
2 Votes
purchase of a subscription
1 Votes
What has happened?
1 Votes
Theater management help me
2 Votes
seats = 100 (blank) seats > 0: print "sell ticket" (blank) = seats - 1
0 Votes
What should I add/improve ?
1 Votes
Flight tracker coding foundation help me
1 Votes
Should You Specialize or Diversify in Programming?
1 Votes