[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

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

3 / 40

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

4 / 40

4. Variables that are created outside of a function

5 / 40

5. Python relies on indentation?

6 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

7 / 40

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

8 / 40

8. Bitwise operators are used to compare (binary) numbers

9 / 40

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

10 / 40

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

11 / 40

11.

What is the value of the expression 100 / 25?

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

12 / 40

12.

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.

13 / 40

13.

What will be the output of above Python code?

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

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

14 / 40

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

 

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

18. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

19 / 40

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

20 / 40

20.

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

21 / 40

21. Python is an interpreted programming language

22 / 40

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

23 / 40

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

24 / 40

24.

Which function overloads the >> operator?

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

25 / 40

25.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

26 / 40

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

27 / 40

27.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

28 / 40

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

29 / 40

29. Python has various versions available

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34. Most recent major version of Python is Python 3

35 / 40

35. With the break statement we can stop the loop before it has looped through all the items

36 / 40

36.

How to copy one list to another in python?

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

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. python file can also run on command line

39 / 40

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

40 / 40

40.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

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.