[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. python has two primitive loop commands:

  • while loops
  • for loops

4 / 40

4.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

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

7 / 40

7.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

8 / 40

8. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

9 / 40

9.

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

10 / 40

10.

What will be the output of above Python code?

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

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

11 / 40

11. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

12 / 40

12. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

13 / 40

13. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

14 / 40

14.

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

15 / 40

15.

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.

16 / 40

16.

What will be the output of below Python code?

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

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

17 / 40

17. Python is a  high-level programming language.

18 / 40

18.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

19 / 40

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

20 / 40

20.

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

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

21 / 40

21. Most recent major version of Python is Python 3

22 / 40

22. You can also have an else without the elif

23 / 40

23. The format() method takes the passed arguments

24 / 40

24. Extension of all Python  Programme are .py

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.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

27 / 40

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

28 / 40

28.

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

29 / 40

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

30 / 40

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

31 / 40

31. You can also have multiple else statements on the same line:

32 / 40

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

33 / 40

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

34 / 40

34.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

35 / 40

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

36 / 40

36.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. Who developed Python Programming Language?

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.