[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

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

3 / 40

3. Python has various versions available

4 / 40

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

5 / 40

5.

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

6 / 40

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

7 / 40

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

8 / 40

8. Comparison operators are not  used to compare two values

9 / 40

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

10 / 40

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

11 / 40

11.

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.

12 / 40

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

13 / 40

13. Extension of all Python  Programme are .py

14 / 40

14. Operators are used to perform operations on variables and values

15 / 40

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

16 / 40

16.

What will be the output of below Python code?

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

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

17 / 40

17. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

18 / 40

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

19 / 40

19.

What is the data type of print(type(0xFF))

20 / 40

20. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

21 / 40

21.

 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.

22 / 40

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

23 / 40

23. An array is a special variable, which can hold more than one value at a time

24 / 40

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

25 / 40

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

26 / 40

26. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

27 / 40

27.

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

28 / 40

28. The for loop does not require an indexing variable to set beforehand

29 / 40

29. Python has a set of built-in methods that you can use on lists/arrays

30 / 40

30. Who developed Python Programming Language?

31 / 40

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

32 / 40

32.

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

a. 2

b. 3

c. 5

d. Multiple times

33 / 40

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

34 / 40

34. Python is a  high-level programming language.

35 / 40

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

36 / 40

36. Python can connect to database systems.

37 / 40

37. + operator is used  to get output of multiple variables

38 / 40

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

39 / 40

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

a. 5

b. 3

c. 6

d. 7

40 / 40

40. Comments can be used to explain Python code.

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.