[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

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. Python has a set of built-in methods that you can use on lists/arrays

6 / 40

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

7 / 40

7.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

8 / 40

8.

 ____________________ 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

9 / 40

9. Python has various versions available

10 / 40

10. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

11 / 40

11.

Which function overloads the >> operator?

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

12 / 40

12. Strings in python are surrounded by either single quotation marks, or double quotation marks

13 / 40

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

14 / 40

14. An array can hold many values under a single name

15 / 40

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

16 / 40

16.

What will be the output of below Python code?

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

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

17 / 40

17. Comparison operators are not  used to compare two values

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21. Comments starts with a #

22 / 40

22.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

23 / 40

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

24 / 40

24.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

25 / 40

25.

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

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

26 / 40

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

27 / 40

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

28 / 40

28.

What will be the output of below Python code?

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

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

29 / 40

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

30 / 40

30. The len() method to return the length of an array

31 / 40

31.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

32 / 40

32. The format() method takes the passed arguments

33 / 40

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

34 / 40

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

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. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

37 / 40

37.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

38 / 40

38.

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

39 / 40

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

40 / 40

40.

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

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.