[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

2 / 40

2. Variable names are case-sensitive

3 / 40

3. python has two primitive loop commands:

  • while loops
  • for loops

4 / 40

4.

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

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

9. Comments starts with a #

10 / 40

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

11 / 40

11.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

12 / 40

12. Comparison operators are not  used to compare two values

13 / 40

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

14 / 40

14. python file can also run on command line

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

18. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22.

What will be the output of below Python code?

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

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

23 / 40

23. Python is an interpreted programming language

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27.

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

28 / 40

28.

 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.

29 / 40

29. Python has various versions available

30 / 40

30.

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

a. True

b. False

31 / 40

31. A variable name must start with a letter or the underscore character

32 / 40

32.

 What is output of: 35 == 35.0

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

33 / 40

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

34 / 40

34. Comments can be used to explain Python code.

35 / 40

35.

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

36 / 40

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

37 / 40

37. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

38 / 40

38. Extension of all Python  Programme are .py

39 / 40

39. Python relies on indentation?

40 / 40

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

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.