
Test Your Python and C Knowledge

Quiz
•
Engineering
•
University
•
Hard
Vinay Vadaparthi
Used 1+ times
FREE Resource
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
Similar Resources on Wayground
12 questions
Quiz on Variables and Arithmetic Operations

Quiz
•
12th Grade - University
13 questions
FlexSim Quiz Assessment 2

Quiz
•
University
10 questions
The oops moment/3

Quiz
•
University
10 questions
Unit1-MPMC

Quiz
•
University
12 questions
Methods of Estimating Quiz

Quiz
•
University
15 questions
Python Basics-Quiz-I

Quiz
•
University
15 questions
SEM-2(Python-Q1)

Quiz
•
University
10 questions
Mastering Java Arithmetic Operators

Quiz
•
10th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Engineering
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University