Q&A Discussions
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 Votes
2 AnswersI want write once program but I can't!, if we write "cout<<"Hello world" ; in a console we can see momental"hello world" and nothing, but now I want see hello world like a gif animation, every letters must be showing step by step, first "H" second "e" and "l" all letters step by step in every sek time, it's possible?, excuse me I am Russian.
0 Votes
2 Answerswhat will be output??
#include <iostream>
using namespace std;
int main(int a)
{
cout << a << "\n";
return 0;
}
int main(char *a)
{
cout << a << endl;
return 0;
}
int main(int a, int b)
{
cout << a << " " << b;
return 0;
}
int main()
{
main(3);
main("Subodh");
main(9, 6);
return 0;
}
if output is compilation compilation error then how can we overload "main" function in C++
0 Votes
5 AnswersQ1: should we always assign one svg size if more than one graphs are drawn?
Q2: again, I want to make two different animations of different shapes? in the same svg, without changing the size, no result?
Q3: and again, in a same svg sized, want to make path with combinations of C, S , A etc, no results?
what is proper ways to do the above? what attentions should we pay to ?
0 Votes
2 AnswersIf except can handle common errors very well, doesn't that make the use of raise redundant inside of a try-except block?
For example:
try:
print( 5 / 0 )
except ZeroDivisionError:
raise ValueError("An error occurred!")
What's the difference if we handle it this way:
try:
print( 5 / 0 )
except (ZeroDivisionError, ValueError):
print("An error occurred!")
3 Votes
2 Answershello guys? how are you. i am zeeshan ali from pakistan. i have been in touch with this app for a very long long time. i have found so many friends awesome.. and we do combine study over the internet. anyone of you is interested then join us on facebook by searching this number 03033951255
0 Votes
4 Answersabout svg. Q1: when setting up layout size, height & width, do we need an extra layout for some things different from the first layout. ie two layouts?
Q2: what is the purpose of the size? how does it affect graphics in it?
Q3: how to treat problem of over lapping or/and over ridding?
1 Vote
2 Answers#include <iostream>
using namespace std;
class A{
public:
void f1();
};
class B : public A{
public:
virtual void f1();
}
int main()
{
A * obj = new B;
obj.f1();
}
Ques: can we write virtual before an overridden function from the base class?? if yes which f1() should it call base class f1() or derived class f1()???
0 Votes
1 AnswerHot today
Javascript
3 Votes
Fitting
0 Votes
Why text takes time to load
1 Votes
Digital currency
1 Votes