[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python is an interpreted programming language

2 / 40

2. Python can be used on a server to create web applications?

3 / 40

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

4 / 40

4. Comparison operators are not  used to compare two values

5 / 40

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

6 / 40

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

7 / 40

7. Comments can’t be used to prevent execution when testing code.

8 / 40

8. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

9 / 40

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

10 / 40

10. We can combine strings and numbers by using the format() method

11 / 40

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

12 / 40

12.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

18. python has two primitive loop commands:

  • while loops
  • for loops

19 / 40

19. Most recent major version of Python is Python 3

20 / 40

20.

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

21 / 40

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

22 / 40

22. Who developed Python Programming Language?

23 / 40

23.

What will be the output of above Python code?

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

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

24 / 40

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

25 / 40

25. Python relies on indentation?

26 / 40

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

27 / 40

27.

Which function overloads the >> operator?

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

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

31. You can also have an else without the elif

32 / 40

32. Python has various versions available

33 / 40

33. Variables that are created outside of a function

34 / 40

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

35 / 40

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

36 / 40

36.

What will be the output of below Python code?

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

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

37 / 40

37. The length of an array is always one more than the highest array index.

38 / 40

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

39 / 40

39. python file can also run on command line

40 / 40

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

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.