[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

3 / 40

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

4 / 40

4. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

5 / 40

5.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

6 / 40

6. Who developed Python Programming Language?

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

11. A variable name cannot start with a number

12 / 40

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

13 / 40

13. Python has various versions available

14 / 40

14. Extension of all Python  Programme are .py

15 / 40

15.

What will be the output of below Python code?

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

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

16 / 40

16.

 Select the correct example of complex datatype in Python

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

17 / 40

17.

What will be the output of above Python code?

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

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

18 / 40

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

19 / 40

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

20 / 40

20. python file can also run on command line

21 / 40

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

22 / 40

22. Python can be install on both  Linux and  Windows

23 / 40

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

24 / 40

24. Variables that are created outside of a function

25 / 40

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

26 / 40

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

27 / 40

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

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. Arrays are used to store multiple values in one single variable.

30 / 40

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

31 / 40

31. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

32 / 40

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

33 / 40

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

34 / 40

34. Comments can be used to make the code more readable.

35 / 40

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

36 / 40

36.

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.

37 / 40

37.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

38 / 40

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

39 / 40

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

40 / 40

40. Python can connect to database systems.

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.