[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

a. Define

b. DEF

c. def

d. Def

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. Arithmetic operators are used with numeric values to perform common mathematical operations

4 / 40

4.

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

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

5 / 40

5.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

6 / 40

6.

What is the value of the expression 100 / 25?

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

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.

 Select the correct example of complex datatype in Python

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

9 / 40

9. To write and execute code in python, we first need to install Python on our system

10 / 40

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

11 / 40

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

12 / 40

12.

 ____________________ 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

13 / 40

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

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

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

14 / 40

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

15 / 40

15.

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

16 / 40

16. Python can connect to database systems.

17 / 40

17. Snake Case
Each word is separated by an underscore character:

18 / 40

18. To write and execute code in python, we first need to install Python on our system.

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22. python file can also run on command line

23 / 40

23.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

24 / 40

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

25 / 40

25. Comments can be used to explain Python code.

26 / 40

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

27 / 40

27.

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

28 / 40

28.

 What is output of: 35 == 35.0

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

29 / 40

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

30 / 40

30.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

31 / 40

31.

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

32 / 40

32.

How to copy one list to another in python?

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

33 / 40

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

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

34 / 40

34. Comparison operators are not  used to compare two values

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38. python has two primitive loop commands:

  • while loops
  • for loops

39 / 40

39. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

40 / 40

40.

 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.

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.