Dyskusje Q&A
1
1 Głos
6 odpowiedzifunction can_i_enter(age)
if (age < 6) { document.write ("you are not allowed to watch Dead pool after 6:00pm.");}
else if (age>=6 && age<17) {document.write("you must be accompanied by a guardian who is 21 or older.");}
else if (age>=17 && age<25) {document.write ("you are allowed to watch Dead pool, right after you show some ID. ")}
else if (age>=25) { document.write ("Yah! you can watch Dead pool with no strings attached!");}
else { document.write ("Invalid age. ");}
can_i_enter (24);
0 głosów
9 odpowiedziHelp me fix this code
1 Głos
1 OdpowiedźOOP Goblin Game
0 głosów
1 OdpowiedźOr in if?
0 głosów
2 odpowiedzipyrhon
-1 Głos
2 odpowiedziRestart Button
0 głosów
2 odpowiedziHello guys right now I am kinda of new in python
my question is related to the function call len()
len() its print out the character but here it's the confusing part, I am working with a list let me explain an example
players
['lee', 'bob', 'moe', 'joe']
len(players)
4
why it's giving me 4 item in the list I thought len it counts the characters and if I do this it give me the correct somewhat answer what I am seeking,
len(players [-1])
3
0 głosów
8 odpowiedziMethod in python
0 głosów
2 odpowiedziwhat 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 głosów
5 odpowiedziwhy when i use editor for that code didn't print the result automatically and i shoud insert print function first
the code is:
float (insert('enter a number: ')) + float (insert(' enter another number: '))
when i use this code in IDLE the program prints the result automatically
0 głosów
3 odpowiedzipython 3
0 głosów
1 Odpowiedź9
2 głosów
6 odpowiedzimy_sort
0 głosów
1 Odpowiedź#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 głosów
1 OdpowiedźTo bind two things of similar origin but separate identities together as one unit with ability to function independently as long and the unit is not corrupted. How to set x to get y and become z permanently and protect the unit from corrupt or deviation or denying or hiding while z securely functions actively is the purpose.
0 głosów
1 OdpowiedźPopularne dzisiaj
Pig Latin
0 Votes
Someone can help me
0 Votes
Please rate my code from 1 to 10
2 Votes
Square Roots
0 Votes
What's wrong with this?
2 Votes
I’m new someone can help me
0 Votes