Q&A Discussões
I have a PHP multiD array like array($arrayA, $arrayB, $arrayA, $arrayC, $arrayC, $arrayA...........)
ho can I get a resulting array which have distinct elements from this array and sorted with the more occurance first like...
array( $arrayA, $arrayB, $arrayC)
because array $arrayA was 3 tumes in first array so it comes first in resulting array.
0 Voto
3 RespostasHow can I make a reference for a list of variables. If false i want the system to check through all my variable to make sure they are false.
Code-
var2 = "Tanner"
var3 = "Jake"
question = input('What is your name? ')
if question == var2:
print('\nWelcome Back Tanner!')
if question == var3:
print('\nWelcome Back Jake!")
if question !=( This is where i need help!)( Is the != the correct way to write not equal?)
0 Voto
4 RespostasWhen I enter two numbers the sum comes.. but when I input character as yes not y... Then it goes into an infinite loop... can anyone explain why?
int a,b;
char ch;
do
{
cout<<"Enter two numbers: ";
cin>>a>>b;
cout<<"The sum is "<<a+b
<<"\nDo you want to try again (y/n): ";
cin>>ch;
}while(ch=='Y'||ch=='y');
0 Voto
2 Respostasdef 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 RespostasQuente hoje
Pig Latin
0 Votes
Please rate my code from 1 to 10
2 Votes
Square Roots
0 Votes
What's wrong with this?
1 Votes
Uuu
2 Votes
How to start
0 Votes
Recursion doubt
2 Votes