[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. You can also use the remove() method to remove an element from the array

3 / 40

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

4 / 40

4.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

5 / 40

5.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

6 / 40

6. A variable name cannot start with a number

7 / 40

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

8 / 40

8.

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

9 / 40

9. Python will give you an error if you skip the indentation

10 / 40

10.

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.

11 / 40

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

12 / 40

12. Python is a  high-level programming language.

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

16.

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

a. 2

b. 3

c. 5

d. Multiple times

17 / 40

17.

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

18 / 40

18. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

19 / 40

19.

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

20 / 40

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

21 / 40

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

22 / 40

22. Official site of python is www.python.org

23 / 40

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

24 / 40

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

25 / 40

25.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

26 / 40

26. python file can also run on command line

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

31 / 40

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

32 / 40

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

33 / 40

33.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

34 / 40

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

35 / 40

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

36 / 40

36.

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

a. True

b. False

37 / 40

37. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

38 / 40

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

39 / 40

39. Python relies on indentation?

40 / 40

40. You can also have an else without the elif

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.