[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

2 / 40

2. Python has a set of built-in methods that you can use on lists/arrays

3 / 40

3.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

4 / 40

4.

What is the data type of print(type(10))

5 / 40

5. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

6 / 40

6. To insert characters that are illegal in a string, use an escape character

7 / 40

7. Python  was created by Guido van Rossum, and released in 1999.

8 / 40

8. 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

9 / 40

9. During Installation Make sure to select both the checkboxes at the bottom .

10 / 40

10. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

a) Hello
b) Know Program
c) Compiled Successfully, No Output.
d) Error

11 / 40

11. Python relies on indentation?

12 / 40

12. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

13 / 40

13. Most recent major version of Python is Python 3

14 / 40

14. A variable name can only contain alpha-numeric characters and
underscores

15 / 40

15.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

16 / 40

16.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

17 / 40

17.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

18 / 40

18.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

19 / 40

19. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

20 / 40

20.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

21 / 40

21.

What is the data type of print(type(0xFF))

22 / 40

22.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

23 / 40

23.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

24 / 40

24. Operators are used to perform operations on variables and values

25 / 40

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

26 / 40

26.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

27 / 40

27. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

28 / 40

28. Comments starts with a #

29 / 40

29.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

30 / 40

30. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

31 / 40

31. Comparison operators are not  used to compare two values

32 / 40

32. python file can also run on command line

33 / 40

33. Arithmetic operators are used with numeric values to perform common mathematical operations

34 / 40

34.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

35 / 40

35. Python is an interpreted programming language

36 / 40

36.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

37 / 40

37. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

38 / 40

38. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

39 / 40

39. Extension of all Python  Programme are .py

40 / 40

40.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

Exit



[hurrytimer id=”2250″]
[wooct_product]

Wrong shortcode initialized


You must log in to see your results.



Wrong shortcode initialized


There are no questions atteched yet.





[ays_quiz_leaderboard id=”Your_Quiz_ID” from=”Y-m-d H:i:sa” to=”Y-m-d H:i:s”]

Category:


Wrong shortcode initialized


[WATU 1]

You must log in to see your results.