[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Comparison operators are not  used to compare two values

2 / 40

2. Python has various versions available

3 / 40

3. Comments can be used to explain Python code.

4 / 40

4.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

5 / 40

5. An array can hold many values under a single name

6 / 40

6.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

7 / 40

7.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

8 / 40

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

9 / 40

9. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

10 / 40

10. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

11 / 40

11.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

12 / 40

12. Camel Case
Each word, except the first, starts with a capital letter:

13 / 40

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

14 / 40

14. You can return a range of characters by using the slice syntax

15 / 40

15. The else keyword catches anything which isn’t caught by the preceding conditions.

16 / 40

16. To write and execute code in python, we first need to install Python on our system

17 / 40

17.

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

18 / 40

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

19 / 40

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

20 / 40

20. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

21 / 40

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

22 / 40

22.

Which function overloads the >> operator?

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

23 / 40

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

24 / 40

24. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

25 / 40

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

26 / 40

26.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

27 / 40

27.

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

28 / 40

28.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

29 / 40

29. Variable names are case-sensitive

30 / 40

30.

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

31 / 40

31. + operator is used  to get output of multiple variables

32 / 40

32. Python can be install on both  Linux and  Windows

33 / 40

33. What will be the output of the following Python code?

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

34 / 40

34.

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

a. 2

b. 3

c. 5

d. Multiple times

35 / 40

35.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

36 / 40

36. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

37 / 40

37. Official site of python is www.python.org

38 / 40

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

39 / 40

39. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

40 / 40

40.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

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.