[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. You can have if statements inside if statements, this is called nested if statements.

2 / 40

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

3 / 40

3.

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

4 / 40

4. Python relies on indentation?

5 / 40

5. Python has various versions available

6 / 40

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

7 / 40

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

8 / 40

8. Python will give you an error if you skip the indentation

9 / 40

9.

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

10 / 40

10. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

11 / 40

11. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

12 / 40

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

13 / 40

13. python file can also run on command line

14 / 40

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

15 / 40

15. You can use the append() method to add an element to an array

16 / 40

16. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

17 / 40

17. The format() method takes unlimited number of arguments

18 / 40

18.

What will be the output of above Python code?

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

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

19 / 40

19.

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

20 / 40

20. You can also have an else without the elif

21 / 40

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

22 / 40

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

23 / 40

23.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28.

What will be the output of below Python code?

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

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

29 / 40

29.

Which is the correct operator for power(xy)?

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

30 / 40

30. Which of the following is the correct extension of the Python file?

31 / 40

31.

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

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

32 / 40

32. Pascal Case
Each word starts with a capital letter:

33 / 40

33.

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

34 / 40

34. With the break statement we can stop the loop even if the while condition is true

35 / 40

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

36 / 40

36. Who developed Python Programming Language?

37 / 40

37.

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

38 / 40

38. python has two primitive loop commands:

  • while loops
  • for loops

39 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

40 / 40

40. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

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.