Fundamentals of C and Python

Fundamentals of C and Python

University

20 Qs

quiz-placeholder

Similar activities

ทดสอบหลังเรียน Microbit M4

ทดสอบหลังเรียน Microbit M4

University

20 Qs

3.3 Block bad input

3.3 Block bad input

7th Grade - University

20 Qs

Flowchart

Flowchart

8th Grade - University

15 Qs

3.4 Traverse a list

3.4 Traverse a list

7th Grade - University

20 Qs

Coding

Coding

4th Grade - University

15 Qs

Google DSC Quiz - 3

Google DSC Quiz - 3

University

18 Qs

Coding Basics

Coding Basics

12th Grade - University

15 Qs

Python Programming

Python Programming

University

25 Qs

Fundamentals of C and Python

Fundamentals of C and Python

Assessment

Quiz

English

University

Medium

Created by

Anil N

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to output 'Hello, World!' in C?

#include \nint main() {\n printf("Hello, World!\n");\n return 0;\n}

print('Hello, World!');

echo 'Hello, World!';

System.out.println('Hello, World!');

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a variable in Python?

You declare a variable in Python by using the syntax: variable_name = value.

variable_name : value

value = variable_name

declare variable_name as value

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'main' function in C?

The 'main' function is the entry point of a C program.

The 'main' function is where all functions are declared.

The 'main' function is responsible for memory management.

The 'main' function is used for defining global variables.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you create a list in Python?

You create a list in Python using curly braces, e.g., my_list = {item1, item2, item3}.

You create a list in Python using square brackets, e.g., my_list = [item1, item2, item3].

You create a list in Python using parentheses, e.g., my_list = (item1, item2, item3).

You create a list in Python by using the list() function, e.g., my_list = list(item1, item2, item3).

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between '==' and '===' in JavaScript?

'==' checks for object identity while '===' checks for value equality

'==' is faster than '==='

'==' is used for strict comparisons while '===' is for loose comparisons

The difference is that '==' allows type coercion while '===' does not.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you write a comment in C?

Use '/*' for single-line comments

Use '//' for multi-line comments

Use '#' for comments

Use '//' for single-line comments and '/* comment */' for multi-line comments.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code: print(2 ** 3) in Python?

8

9

4

6

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?

Discover more resources for English