[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

2 / 40

2. Who developed Python Programming Language?

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6.

Which is the correct operator for power(xy)?

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

15 / 40

15.

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

16 / 40

16. Python can connect to database systems.

17 / 40

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

18 / 40

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

19 / 40

19.

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

20 / 40

20. Extension of all Python  Programme are .py

21 / 40

21.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

22 / 40

22.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

23 / 40

23. python has two primitive loop commands:

  • while loops
  • for loops

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27.

 Select the correct example of complex datatype in Python

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

28 / 40

28.

 ____________________ 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

29 / 40

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

30 / 40

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

31 / 40

31. Variable names are case-sensitive

32 / 40

32.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

33 / 40

33. To insert characters that are illegal in a string, use an escape character

34 / 40

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

35 / 40

35.

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

36 / 40

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

37 / 40

37.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

38 / 40

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

39 / 40

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

40 / 40

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

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.