[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python relies on indentation?

2 / 40

2.

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

3 / 40

3.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

4 / 40

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

5 / 40

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

6 / 40

6.

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

7 / 40

7. Camel Case
Each word, except the first, starts with a capital letter:

8 / 40

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

9 / 40

9. Variables that are created outside of a function

10 / 40

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

11 / 40

11.

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

12 / 40

12.

 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.

13 / 40

13. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

14 / 40

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

15 / 40

15.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

16 / 40

16.

What is the value of the expression 100 / 25?

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

17 / 40

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

a. 5

b. 3

c. 6

d. 7

18 / 40

18.

 ____________________ 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

19 / 40

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

20 / 40

20. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

21 / 40

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

22 / 40

22.

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

23 / 40

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

24 / 40

24. The format() method takes unlimited number of arguments

25 / 40

25. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

26 / 40

26.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

27 / 40

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

28 / 40

28. Python has various versions available

29 / 40

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

30 / 40

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

31 / 40

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

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

32 / 40

32.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

33 / 40

33.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

34 / 40

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

35 / 40

35. To write and execute code in python, we first need to install Python on our system

36 / 40

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

37 / 40

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

38 / 40

38. Python can connect to database systems.

39 / 40

39. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

40 / 40

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

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.