[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

2 / 40

2.

Which is the correct operator for power(xy)?

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

3 / 40

3. Python  was created by Guido van Rossum, and released in 1999.

4 / 40

4. python has two primitive loop commands:

  • while loops
  • for loops

5 / 40

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

a. 5

b. 3

c. 6

d. 7

6 / 40

6.

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

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

7 / 40

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

8 / 40

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

9 / 40

9. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

10 / 40

10. Extension of all Python  Programme are .py

11 / 40

11.

 Select the correct example of complex datatype in Python

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

12 / 40

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

13 / 40

13.

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.

14 / 40

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

15 / 40

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

16 / 40

16. You can also have multiple else statements on the same line:

17 / 40

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

 

18 / 40

18.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

19 / 40

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

20 / 40

20. Python is an interpreted programming language

21 / 40

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

22 / 40

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

23 / 40

23. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

24 / 40

24.

What will be the output of below Python code?

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

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

25 / 40

25. A variable name cannot start with a number

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29.

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

30 / 40

30. Arithmetic operators are used with numeric values to perform common mathematical operations

31 / 40

31.

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

32 / 40

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

33 / 40

33.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

34 / 40

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

35 / 40

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

36 / 40

36. Most recent major version of Python is Python 3

37 / 40

37.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

38 / 40

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

39 / 40

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

40 / 40

40. Python has various versions available

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.