[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. The format() method takes the passed arguments

2 / 40

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

3 / 40

3.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

4 / 40

4. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

5 / 40

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

6 / 40

6. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

7 / 40

7. Arrays are used to store multiple values in one single variable.

8 / 40

8.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

9 / 40

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

10 / 40

10. Most recent major version of Python is Python 3

11 / 40

11.

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.

12 / 40

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

13 / 40

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

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

16 / 40

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

17 / 40

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

18 / 40

18. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

19 / 40

19.

 Select the correct example of complex datatype in Python

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

20 / 40

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

21 / 40

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

22 / 40

22. You can have if statements inside if statements, this is called nested if statements.

23 / 40

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

24 / 40

24. Python is a  high-level programming language.

25 / 40

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

26 / 40

26.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

27 / 40

27. Comparison operators are not  used to compare two values

28 / 40

28. Variable names are case-sensitive

29 / 40

29.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

30 / 40

30.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

31 / 40

31.

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

a. 2

b. 3

c. 5

d. Multiple times

32 / 40

32. Extension of all Python  Programme are .py

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. An array can hold many values under a single name

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.