GFG Final Quiz

GFG Final Quiz

University

10 Qs

quiz-placeholder

Similar activities

TEST 4 - K16

TEST 4 - K16

University

10 Qs

 Comment les contrats sécurisent-ils les relations entre l’entre

Comment les contrats sécurisent-ils les relations entre l’entre

University

14 Qs

POST TEST MPLS ONLINE SMK NEGERI 1 TUTUYAN 2020

POST TEST MPLS ONLINE SMK NEGERI 1 TUTUYAN 2020

KG - Professional Development

15 Qs

Quiz PBI Kelas A

Quiz PBI Kelas A

University

10 Qs

METODOLOGÍA DE LA INVESTIGACIÓN GRUPO 27

METODOLOGÍA DE LA INVESTIGACIÓN GRUPO 27

University

11 Qs

De la musique avant toute chose (mots-clés)

De la musique avant toute chose (mots-clés)

University

14 Qs

Komdat P2

Komdat P2

University

10 Qs

POs and BTL

POs and BTL

University

15 Qs

GFG Final Quiz

GFG Final Quiz

Assessment

Quiz

Education

University

Hard

Created by

Mokshith Thota

Used 1+ times

FREE Resource

AI

Enhance your content

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?