My opinion is the answers A and D. I would choose A if you can only choose one, though.
Answer:
c = 1 # global variable
jhjl jh
def add():
c = 1 # global variable
def add():
print(c)
add()
c = c + 2 # increment c by 2
print(c)
add()
Explanation:
Here is a somewhat cryptic solution that works:
#include <algorithm>
#include <cstdlib>
using namespace std;
void q(char c, int count)
{
for (int i = 0; i < count; i++) {
putchar(c);
}
}
void p(int b1, int plusses)
{
q(' ', b1);
q('+', plusses);
}
int main()
{
for (int i = -3; i <= 3; i++)
{
int pl = min(6, (3 - abs(i)) * 2 + 1);
p(6-pl, pl);
i == 0 ? p(0, 6) : p(6, 0);
p(0, pl);
putchar('\n');
}
getchar();
}
Answer:
def recursive_func():
x = input("Are we there yet?")
if x.casefold() == 'Yes'.casefold():
return
else:
recursive_func()
recursive_func()
Explanation:
We define the required function as recursive_func().
The first line takes user input. The user input is stored in variable x.
The next line compares the user input to a string yes. The function executes the else block if the condition isn't met, that is a recursive call is executed.
IF condition returns the function. The string in variable X is compared to a string 'Yes'. the casefold() is a string function that ignores the upper/lower cases when comparing two strings. (This is important because a string 'yes' is not the same yes a string 'Yes' or 'YES'. Two equal strings means their cases and length should match).
C Ask himself what his purposes will be for using a database. You have to figure out the basics first