GFG Final Quiz

GFG Final Quiz

University

10 Qs

quiz-placeholder

Similar activities

Dasar Pemrograman PSDKU LUMAJANG

Dasar Pemrograman PSDKU LUMAJANG

University

10 Qs

PTS PEMROGRAMAN DASAR

PTS PEMROGRAMAN DASAR

University

15 Qs

1.0 Introduction To Fundamentals Of Programming

1.0 Introduction To Fundamentals Of Programming

University

10 Qs

JAVA FUNDAMENTALS

JAVA FUNDAMENTALS

University

12 Qs

C# dolgozat

C# dolgozat

11th Grade - University

15 Qs

Basic Python

Basic Python

10th Grade - University

10 Qs

Phyton  Review Lesson 1-10

Phyton Review Lesson 1-10

12th Grade - Professional Development

5 Qs

c_programming_1

c_programming_1

University

14 Qs

GFG Final Quiz

GFG Final Quiz

Assessment

Quiz

Education

University

Hard

Created by

Mokshith Thota

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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)

1 2 8
1 6 8
1 2 6
6 2 8

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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)))

12
TypeError: f1() takes from 2 to 5 positional arguments but 6 were given
11
13

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

The program doesn't have a colon at the end of the while loop
The program doesn't have a space between int(input()) and for

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

It will print a square of asterisks with n rows and n columns
It will print a line of n asterisks
It will print a pyramid of asterisks with n rows

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?

class tester:

def init(self, id):

self.id = str(id)

id = "224"

temp = tester(12)

print(temp.id)

12
224
None
Error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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;

}

10 20
20 10
10 1
1 10

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?