[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. Which of the following is the correct extension of the Python file?

3 / 40

3. + operator is used  to get output of multiple variables

4 / 40

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

5 / 40

5.

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

a. Define

b. DEF

c. def

d. Def

6 / 40

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

7 / 40

7. Comments can be used to explain Python code.

8 / 40

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

9 / 40

9.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

10 / 40

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

11 / 40

11.

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

12 / 40

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

13 / 40

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

14 / 40

14. Python can connect to database systems.

15 / 40

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

16 / 40

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

17 / 40

17. Python is an interpreted programming language

18 / 40

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

19 / 40

19. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

20 / 40

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

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

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

21 / 40

21.

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.

22 / 40

22. Python is a  high-level programming language.

23 / 40

23. You can use the pop() method to remove an element from the array

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27.

What will be the output of below Python code?

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

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

28 / 40

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

29 / 40

29.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

30 / 40

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

31 / 40

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

32 / 40

32.

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

33 / 40

33.

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

34 / 40

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

35 / 40

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

36 / 40

36.

Which is the correct operator for power(xy)?

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

37 / 40

37. Extension of all Python  Programme are .py

38 / 40

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

39 / 40

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

40 / 40

40.

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

a. [ ]

b. { }

c. ( )

d. None of the above

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.