[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. The format() method takes unlimited number of arguments

3 / 40

3. Comments can be used to explain Python code.

4 / 40

4.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

5 / 40

5. You can return a range of characters by using the slice syntax

6 / 40

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

7 / 40

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

8 / 40

8.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13. Most recent major version of Python is Python 3

14 / 40

14.

What will be the output of above Python code?

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

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

15 / 40

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

16 / 40

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

17 / 40

17.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

18 / 40

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

19 / 40

19. Comparison operators are not  used to compare two values

20 / 40

20. Python allows you to extract the values into variables.

21 / 40

21.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

22 / 40

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

23 / 40

23.

What will be the output of below Python code?

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

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

24 / 40

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

25 / 40

25.

 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.

26 / 40

26.

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.

27 / 40

27. The format() method takes the passed arguments

28 / 40

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

29 / 40

29. Python has various versions available

30 / 40

30.

What is the data type of print(type(0xFF))

31 / 40

31. Python can be treated in a procedural way, an object-oriented way or a functional way.

32 / 40

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

33 / 40

33. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

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

34 / 40

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

35 / 40

35. A variable name cannot start with a number

36 / 40

36. python has two primitive loop commands:

  • while loops
  • for loops

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. Python can connect to database systems.

39 / 40

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

40 / 40

40.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

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.