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

2 / 40

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

3 / 40

3.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

4 / 40

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

5 / 40

5.

What will be the output of below Python code?

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

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

6 / 40

6.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

7 / 40

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

8 / 40

8. Python can be install on both  Linux and  Windows

9 / 40

9.

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

10 / 40

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

11 / 40

11.

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

12 / 40

12. You can have if statements inside if statements, this is called nested if statements.

13 / 40

13.

 ____________________ 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

14 / 40

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

15 / 40

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

16 / 40

16.

 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.

17 / 40

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

18 / 40

18. Indentation refers to the spaces at the beginning of a code line.

19 / 40

19. Variables that are created outside of a function

20 / 40

20. Pip is  not a powerful package management system for Python software packages

21 / 40

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

22 / 40

22.

How to copy one list to another in python?

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

23 / 40

23.

What will be the output of below Python code?

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

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27.

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.

28 / 40

28.

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

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

29 / 40

29.

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

30 / 40

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

31 / 40

31.

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

32 / 40

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

33 / 40

33. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

34 / 40

34.

What is the value of the expression 100 / 25?

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

35 / 40

35. Who developed Python Programming Language?

36 / 40

36. Variable names are case-sensitive

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

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

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.