[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Most recent major version of Python is Python 3

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6. With the break statement we can stop the loop before it has looped through all the items

7 / 40

7. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

8 / 40

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

9 / 40

9.

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

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

10 / 40

10. Python is a  high-level programming language.

11 / 40

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

12 / 40

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

13 / 40

13.

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

14 / 40

14. python file can also run on command line

15 / 40

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

16 / 40

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

17 / 40

17. Python has various versions available

18 / 40

18.

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

19 / 40

19. Arrays are used to store multiple values in one single variable.

20 / 40

20. Python can be install on both  Linux and  Windows

21 / 40

21.

What will be the output of below Python code?

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

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

22 / 40

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

23 / 40

23.

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

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

24 / 40

24.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

25 / 40

25.

Which function overloads the >> operator?

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

26 / 40

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

27 / 40

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

28 / 40

28. Comparison operators are not  used to compare two values

29 / 40

29. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

30 / 40

30. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34.

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

35 / 40

35.

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

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

36 / 40

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

37 / 40

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

38 / 40

38. Comments starts with a #

39 / 40

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

40 / 40

40.

What will be the output of above Python code?

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

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

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.