[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Variable names are case-sensitive

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

7.

 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.

8 / 40

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

9 / 40

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

10 / 40

10.

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

11 / 40

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

12 / 40

12.

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

a. 2

b. 3

c. 5

d. Multiple times

13 / 40

13.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

14 / 40

14.

 ____________________ 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

15 / 40

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

16 / 40

16.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

17 / 40

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

18 / 40

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

19 / 40

19.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

20 / 40

20. Comparison operators are not  used to compare two values

21 / 40

21.

What will be the output of below Python code?

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

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

22 / 40

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

23 / 40

23. The format() method takes the passed arguments

24 / 40

24. A variable name cannot start with a number

25 / 40

25. Python is a  high-level programming language.

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29. Python can connect to database systems.

30 / 40

30.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

35 / 40

35.

Which function overloads the >> operator?

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

36 / 40

36. Comments can be used to explain Python code.

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

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

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.