[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. python has two primitive loop commands:

  • while loops
  • for loops

2 / 40

2. Comments can be used to explain Python code.

3 / 40

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

4 / 40

4. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

5 / 40

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

6 / 40

6.

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

13 / 40

13.

 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.

14 / 40

14.

What will be the output of below Python code?

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

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

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

18. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

19 / 40

19.

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

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

20 / 40

20. Pascal Case
Each word starts with a capital letter:

21 / 40

21.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

22 / 40

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

23 / 40

23. The format() method takes the passed arguments

24 / 40

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

25 / 40

25.

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

26 / 40

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

27 / 40

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

28 / 40

28.

What is the value of the expression 100 / 25?

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

29 / 40

29. A variable name cannot start with a number

30 / 40

30. Comparison operators are not  used to compare two values

31 / 40

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

32 / 40

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

33 / 40

33. The len() method to return the length of an array

34 / 40

34. Who developed Python Programming Language?

35 / 40

35. Python can be used to handle big data and perform complex mathematics.

36 / 40

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

37 / 40

37.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

38 / 40

38.

 ____________________ 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

39 / 40

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

40 / 40

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

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.