[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. Snake Case
Each word is separated by an underscore character:

3 / 40

3.

What will be the output of above Python code?

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

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

4 / 40

4. Comments starts with a #

5 / 40

5. Variables that are created outside of a function

6 / 40

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

7 / 40

7.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

11.

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

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

12 / 40

12. Python is an interpreted programming language

13 / 40

13. python file can also run on command line

14 / 40

14. Variable names are case-sensitive

15 / 40

15. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

16 / 40

16. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

17 / 40

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

18 / 40

18.

 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.

19 / 40

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

20 / 40

20. Comparison operators are not  used to compare two values

21 / 40

21.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

22 / 40

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

23 / 40

23. Which of the following is the correct extension of the Python file?

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29. An array can hold many values under a single name

30 / 40

30. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

31 / 40

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

a. 5

b. 3

c. 6

d. 7

32 / 40

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

33 / 40

33.

Which function overloads the >> operator?

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

34 / 40

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

35 / 40

35.

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

36 / 40

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

37 / 40

37.

 What is output of: 35 == 35.0

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

38 / 40

38.

What will be the output of below Python code?

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

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

39 / 40

39.

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.

40 / 40

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

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.