[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. python file can also run on command line

4 / 40

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

5 / 40

5. 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”

6 / 40

6. Extension of all Python  Programme are .py

7 / 40

7. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

8 / 40

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

9 / 40

9. Who developed Python Programming Language?

10 / 40

10.

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

11 / 40

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

12 / 40

12.

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

13 / 40

13. Snake Case
Each word is separated by an underscore character:

14 / 40

14.

 Select the correct example of complex datatype in Python

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

15 / 40

15. Python is a  high-level programming language.

16 / 40

16.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

17 / 40

17. The len() method to return the length of an array

18 / 40

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

19 / 40

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

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

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

20 / 40

20.

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

a. 2

b. 3

c. 5

d. Multiple times

21 / 40

21.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

22 / 40

22.

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

a. Define

b. DEF

c. def

d. Def

23 / 40

23. Python can be treated in a procedural way, an object-oriented way or a functional way.

24 / 40

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

25 / 40

25.

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.

26 / 40

26.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

27 / 40

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

28 / 40

28. A variable name must start with a letter or the underscore character

29 / 40

29. Python can be used to handle big data and perform complex mathematics.

30 / 40

30. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

31 / 40

31. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

32 / 40

32. The list’s remove() method only removes the first occurrence of the specified value.

33 / 40

33.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

34 / 40

34. Most recent major version of Python is Python 3

35 / 40

35. print() function is often used to output variables.

36 / 40

36. Python can connect to database systems.

37 / 40

37. With the for loop we can execute a set of statements

38 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

39 / 40

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

40 / 40

40. You can use the pop() method to remove an element from the array

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.