Python Programming

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

What will be the output of the following Python code snippet if x=1? x<<2 a) 4 b) 2 c) 1 d) 8

a) 4

What are the values of the following Python expressions? 2**(3**2) (2**3)**2 2**3**2 a) 512, 64, 512 b) 512, 512, 512 c) 64, 512, 64 d) 64, 64, 64

a) 512, 64, 512

What will be the value of the following Python expression? 4 + 3 % 5 a) 7 b) 2 c) 4 d) 1

a) 7

Which of the following is used to define a block of code in Python language? a) Indentation b) Key c) Brackets d) All of the mentioned

a) Indentation

Is Python code compiled or interpreted? a) Python code is both compiled and interpreted b) Python code is neither compiled nor interpreted c) Python code is only compiled d) Python code is only interpreted

a) Python code is both compiled and interpreted

Which of the following character is used to give single-line comments in Python? a) // b) # c) ! d) /*

b) #

Which of the following is the truncation division operator in Python? a) | b) // c) / d) %

b) //

Which keyword is used for function in Python language? a) Function b) def c) Fun d) Define

b) def

Which one of the following is not a keyword in Python language? a) pass b) eval c) assert d) nonlocal

b) eval

All keywords in Python are in _________ a) Capitalized b) lower case c) UPPER CASE d) None of the mentioned

b) lower case

Which of the following functions is a built-in function in python? a) factorial() b) print() c) seed() d) sqrt()

b) print()

Which of the following is true for variable names in Python? a) underscore and ampersand are the only two special characters allowed b) unlimited length c) all private members must have leading and trailing underscores d) none of the mentioned

b) unlimited length

Which of the following is the correct extension of the Python file? a) .python b) .pl c) .py d) .p

c) .py

What will be the output of the following Python code snippet if x=1? x>>2 a) 4 b) 2 c) 0 d) 8

c) 0

What are the two main types of functions in Python? a) System function b) Custom function c) Built-in function & User defined function d) User function

c) Built-in function & User defined function

What will be the output of the following Python code snippet if x=1? x<<8 a) 142 b) 250 c) 156 d) 256

d) 256

What is the order of precedence in python? a) Exponential, Parentheses, Multiplication, Division, Addition, Subtraction b) Exponential, Parentheses, Division, Multiplication, Addition, Subtraction c) Parentheses, Exponential, Multiplication, Division, Subtraction, Addition d) Parentheses, Exponential, Multiplication, Division, Addition, Subtraction

d) Parentheses, Exponential, Multiplication, Division, Addition, Subtraction

he value of the Python expression given below would be: 4+2**5//10 a. 77 b. 0 c. 3 d. 7

(d) 7

What will be the output a = 4.5 b = 2 print (a//b)

2.0

Which is invalid in python for z = 5 ? A - z = z++ B - z = ++z C - z += 1 D - z -= 1

A - z = z++

Which type of Programming does Python support? a) object-oriented programming b) structured programming c) functional programming d) all of the mentioned

All of the mentioned

Amongst which of the following is / are the application areas of Python programming? Web Development Game Development Artificial Intelligence and Machine Learning All of the mentioned above

All of the mentioned above

What is output of − 33 == 33.0 A - False B - True C - 33 D - None of the above

B - True

Who developed Python Programming Language?

Guido van Rossum

Python is a ___object-oriented programming language. Special purpose General purpose Medium level programming language All of the mentioned above

General purpose

What is the output of 19 % 2 in python? 2 17 Zero None of the above

None of the above

Which one of the following has the highest precedence in the expression? Addition Multiplication Exponential Parentheses

Parentheses

Find the invalid variable among the following: a. 1st_string b. my_string_1 c. _ d. foo

a. 1st_string

Is Python case sensitive when dealing with identifiers?

Yes

Which of the following refers to mathematical function? sqrt add rhombus None of the above

sqrt


Kaugnay na mga set ng pag-aaral

Transition Metals with Polyatomic Ions

View Set

Chemistry - Chapter 11 Theories of Covalent Bonding

View Set

Network+ Chapter 10- Network Segmentation and Virtualization (Review Questions)

View Set

Combo with "Combo with "BYU Econ Review #3" and 20 others" and 21 others

View Set

3.20 Quiz: Respiration and Photosynthesis

View Set