[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Pip is  not a powerful package management system for Python software packages

3 / 40

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

4 / 40

4.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

5 / 40

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

6 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

7 / 40

7. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

8 / 40

8. Python  was created by Guido van Rossum, and released in 1999.

9 / 40

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

10 / 40

10. Variables that are created outside of a function

11 / 40

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

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

14 / 40

14. Extension of all Python  Programme are .py

15 / 40

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

16 / 40

16. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

17 / 40

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

18 / 40

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

19 / 40

19.

What is the data type of print(type(10))

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

23.

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

24 / 40

24. You can also have an else without the elif

25 / 40

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

26 / 40

26. Comments can be used to explain Python code.

27 / 40

27.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

33 / 40

33.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

34 / 40

34.

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

35 / 40

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

36 / 40

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

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

37 / 40

37. Comparison operators are not  used to compare two values

38 / 40

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

39 / 40

39.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

40 / 40

40. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
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.