Test Your Python and C Knowledge

Test Your Python and C Knowledge

University

10 Qs

quiz-placeholder

Similar activities

Unit 1: Introduction to microcontrollers

Unit 1: Introduction to microcontrollers

University

12 Qs

AMJ21003 Thermodynamics: Chapter 6

AMJ21003 Thermodynamics: Chapter 6

University

10 Qs

Computer Vision

Computer Vision

University

10 Qs

CRYPTIC HEIST ROUND-1 FOR TEAM MEMBER-1

CRYPTIC HEIST ROUND-1 FOR TEAM MEMBER-1

University

10 Qs

Air Tech - Airframe and Undercarriage

Air Tech - Airframe and Undercarriage

University

11 Qs

SIM- Module 1

SIM- Module 1

University

10 Qs

C Programming Day-10

C Programming Day-10

University

10 Qs

Internal Lab Quiz-1 CSECS

Internal Lab Quiz-1 CSECS

University

10 Qs

Test Your Python and C Knowledge

Test Your Python and C Knowledge

Assessment

Quiz

Engineering

University

Hard

Created by

Vinay Vadaparthi

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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 is the correct syntax to define a function in Python?

define function_name(parameters):

function_name(parameters) = def

def function_name(parameters):

function function_name(parameters)

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In C, how do you declare a variable of type integer?

int myVariable;

var myVariable;

integer myVariable;

float myVariable;

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'self' keyword in Python?

The 'self' keyword is a built-in function for string manipulation.

The 'self' keyword is used to create static methods in a class.

The 'self' keyword is used to refer to the instance of the class.

The 'self' keyword is used to define a class in Python.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the difference between 'malloc' and 'calloc' in C.

'malloc' and 'calloc' are the same function

'malloc' allocates memory without initialization, while 'calloc' allocates memory and initializes it to zero.

'malloc' allocates memory and initializes it to a random value

'calloc' allocates memory without any parameters

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a pointer in C and how is it declared?

A pointer in C is declared using the syntax 'type *pointerName;'. For example, 'int *ptr;' declares a pointer to an integer.

A pointer in C is a variable that holds a string value.

A pointer in C is declared using 'type pointerName;'.

A pointer in C is declared with the syntax 'pointerName *type;'.

6.

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 = {1, 2, 3}.

You create a list in Python using parentheses, e.g., my_list = (1, 2, 3).

You create a list in Python by using the list() function, e.g., my_list = list(1, 2, 3).

You create a list in Python using square brackets, e.g., my_list = [1, 2, 3].

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

4

8

6

9

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?