[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

Which is the correct operator for power(xy)?

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

3 / 40

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

4 / 40

4. A variable name must start with a letter or the underscore character

5 / 40

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

6 / 40

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

7 / 40

7. A variable name cannot start with a number

8 / 40

8. Most recent major version of Python is Python 3

9 / 40

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

10 / 40

10.

What will be the output of below Python code?

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

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

19. Pascal Case
Each word starts with a capital letter:

20 / 40

20. Python is a  high-level programming language.

21 / 40

21. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

22 / 40

22. Python relies on indentation?

23 / 40

23.

How to copy one list to another in python?

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

24 / 40

24. print() function is often used to output variables.

25 / 40

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

26 / 40

26. You can also have multiple else statements on the same line:

27 / 40

27.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

28 / 40

28. An array is a special variable, which can hold more than one value at a time

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32. Variable names are case-sensitive

33 / 40

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

34 / 40

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

35 / 40

35.

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

36 / 40

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

37 / 40

37. Python can be install on both  Linux and  Windows

38 / 40

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

39 / 40

39. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

40 / 40

40. Python will give you an error if you skip the indentation

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.