[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python has various versions available

2 / 40

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

3 / 40

3. Comments can be used to explain Python code.

4 / 40

4. Strings in python are surrounded by either single quotation marks, or double quotation marks

5 / 40

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

6 / 40

6. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

7 / 40

7.

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

8 / 40

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

9 / 40

9. Python is a  high-level programming language.

10 / 40

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

11 / 40

11. Most recent major version of Python is Python 3

12 / 40

12.

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

13 / 40

13. The for loop does not require an indexing variable to set beforehand

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17.

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

a. [ ]

b. { }

c. ( )

d. None of the above

18 / 40

18.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

19 / 40

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

20 / 40

20. python has two primitive loop commands:

  • while loops
  • for loops

21 / 40

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

22 / 40

22.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

23 / 40

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

24 / 40

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

25 / 40

25. python file can also run on command line

26 / 40

26. You can also have an else without the elif

27 / 40

27.

 Select the correct example of complex datatype in Python

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

28 / 40

28.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

29 / 40

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

30 / 40

30. Extension of all Python  Programme are .py

31 / 40

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

32 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

33 / 40

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

34 / 40

34. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

35 / 40

35. What will be the output of the following Python code?

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

36 / 40

36. The len() method to return the length of an array

37 / 40

37. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

38 / 40

38.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

39 / 40

39. Bitwise operators are used to compare (binary) numbers

40 / 40

40.

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.

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.