NEW
Font size
WorksheetsGFG Final Quiz
Total questions: 10
Worksheet time: 5mins
What will be the output of the following Python code snippet?
def func(a, b=6, c=8):
print(a, b, c)
func(1, 2)
What will be the output of the following Python code?
def f1(a, b, c=0, d=0, e=0):
return a + b + c + d + e
print(f1(1, *(5, 6)))
n = int(input())
for row_num in range(0,n+1):
row_output = ""
seq_num = row_num
while seq_num > 0:
row_output = row_output + str(seq_num)
seq_num = seq_num - 1
print(row_output)
identify mistakes in program
The program doesn't have any mistakes
program doesnot have correct logic
n = int(input())
for i in range(n):
if i == 0:
space = (n-1) * " "
print(space + "*")
elif i == n - 1:
print(n " ")
else:
left_spaces = (n - i - 1) * " "
stars = "* " * (i + 1)
print(left_spaces+ stars)
guess the output
It will print a triangle of asterisks with n rows
What is the output of the following C code?
#include <stdio.h>
int main() {
int a = 5;
int b = a = 4;
printf("%d %d\n", a, b);
return 0;
}
5 5
44
45
54
What is the output of the following C code?
#include <stdio.h>
int main() {
int a = 10, b = 20, c = 30;
printf("%d ", a);
if (a = b < c)
printf("%d ", a);
else
printf("%d ", b);
return 0;
}
What is the output of the following C code?
#include <stdio.h>
int main() {
static int var = 5;
printf("%d ", var--);
if (var)
main();
return 0;
}
what is the full form USSR
Largest water falls in the world ?
