[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

2 / 40

2.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

3 / 40

3.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

4 / 40

4. The format() method takes the passed arguments

5 / 40

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

6 / 40

6. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

7 / 40

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

8 / 40

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

9 / 40

9.

What will be the output of above Python code?

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

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

10 / 40

10.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14. Comparison operators are not  used to compare two values

15 / 40

15.

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.

16 / 40

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

17 / 40

17. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

18 / 40

18. python file can also run on command line

19 / 40

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

20 / 40

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

21 / 40

21. Python is a  high-level programming language.

22 / 40

22.

Which function overloads the >> operator?

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

23 / 40

23. Python has various versions available

24 / 40

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

25 / 40

25. Extension of all Python  Programme are .py

26 / 40

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

27 / 40

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

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.

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.

30 / 40

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

31 / 40

31. Most recent major version of Python is Python 3

32 / 40

32. Variables that are created outside of a function

33 / 40

33. Who developed Python Programming Language?

34 / 40

34.

Which is the correct operator for power(xy)?

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

35 / 40

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

36 / 40

36.

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

37 / 40

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

38 / 40

38. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

39 / 40

39. Indentation refers to the spaces at the beginning of a code line.

40 / 40

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

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.