[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

2 / 40

2. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

3 / 40

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

4 / 40

4. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

5 / 40

5. You can also have an else without the elif

6 / 40

6. Comments can’t be used to prevent execution when testing code.

7 / 40

7. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

8 / 40

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

9 / 40

9. The format() method takes the passed arguments

10 / 40

10.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

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.

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

17 / 40

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

18 / 40

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

19 / 40

19.

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

a. 2

b. 3

c. 5

d. Multiple times

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25. Python is a  high-level programming language.

26 / 40

26.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

27 / 40

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

28 / 40

28.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

29 / 40

29. Variable names are case-sensitive

30 / 40

30. Is there any comments in  following codes

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

 

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

35. Python is an interpreted programming language

36 / 40

36. Python can connect to database systems.

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. Extension of all Python  Programme are .py

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.