[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python can be install on both  Linux and  Windows

2 / 40

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

3 / 40

3. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

4 / 40

4.

Which function overloads the >> operator?

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

5 / 40

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

6 / 40

6.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

7 / 40

7. Python can connect to database systems.

8 / 40

8. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

9 / 40

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

10 / 40

10.

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

11 / 40

11. A variable name can only contain alpha-numeric characters and
underscores

12 / 40

12. During Installation Make sure to select both the checkboxes at the bottom .

13 / 40

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

14 / 40

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

15 / 40

15. The format() method takes the passed arguments

16 / 40

16.

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

17 / 40

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

18 / 40

18. print() function is often used to output variables.

19 / 40

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

20 / 40

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

21 / 40

21.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

22 / 40

22. Is there any comments in  following codes

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

 

23 / 40

23. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

24 / 40

24. You can also have an else without the elif

25 / 40

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

26 / 40

26. Python allows you to extract the values into variables.

27 / 40

27. A variable name cannot start with a number

28 / 40

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

29 / 40

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

30 / 40

30. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

31 / 40

31. Variable names are case-sensitive

32 / 40

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

33 / 40

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

34 / 40

34. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

35 / 40

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

36 / 40

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

37 / 40

37.

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

38 / 40

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

39 / 40

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

40 / 40

40.

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

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.