Q&A Discussões
def add(x, y):
return x + y
def do_twice(func, x, y):
return func(func(x, y), func(x, y))
a = 5
b = 10
print(do_twice(add, a, b))
Please explain step by step
Which is caller here?
Explain the 3rd and 4th line ?
why in 4th line we write add(add(x,y),add(x,y)) which is function of 1st line ?
how can we write function after return statement insted of (x+y+x+y )=30?
0 Voto
2 RespostasWhat ever I learned here most of the things are not working in turbo c++ ? i.e . instead of iostrem I have to write iostream. h . why is this so?? also it is not accepting this- using namespace std;
. and also not accepting return 0; . Please help me iam really confused. Thanks :)
0 Voto
5 Respostaswhat should i use to get in to next line ?
words=["Hello","world","!"]
print(words[0]) {then i pushed enter to write next line,but gave me answer , i mean i couldn't follow order that has been given}
Hello
and how should i write print(words[1]) in next lint without interruption? 😕
0 Voto
4 RespostasI dont unserstand the output if this code :
# string formatting
nums = [4, 5, 6]
msg = "Numbers: {0} {0} {2}". format(nums[0], nums[1], nums[2])
print(msg)
4 4 6
but when I do :
# string formatting
nums = [4, 5, 6]
msg = "Numbers: {0} {0} {2}". format(nums[1], nums[1], nums[2])
print(msg)
it gives me
5 5 6
is there a priority in the Reading ?
0 Voto
5 RespostasQuente hoje
Help please?
4 Votes
Ejercicio Pytho
0 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
Game development
0 Votes
Ruby programming?
3 Votes