[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

2 / 40

2. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

3 / 40

3.

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

4 / 40

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

5 / 40

5. python file can also run on command line

6 / 40

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

7 / 40

7. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

8 / 40

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

9 / 40

9. Pascal Case
Each word starts with a capital letter:

10 / 40

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

11 / 40

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

12 / 40

12.

 What is output of: 35 == 35.0

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

13 / 40

13.

What is the value of the expression 100 / 25?

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

14 / 40

14.

What will be the output of below Python code?

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

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

15 / 40

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

16 / 40

16.

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

a. Define

b. DEF

c. def

d. Def

17 / 40

17.

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

18 / 40

18.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

19 / 40

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

20 / 40

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

21 / 40

21.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

22 / 40

22. Python can be treated in a procedural way, an object-oriented way or a functional way.

23 / 40

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

24 / 40

24.

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

25 / 40

25. The list’s remove() method only removes the first occurrence of the specified value.

26 / 40

26.

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

27 / 40

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

28 / 40

28.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

29 / 40

29.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

30 / 40

30. Python can be install on both  Linux and  Windows

31 / 40

31. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

32 / 40

32.

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

33 / 40

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

34 / 40

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

35 / 40

35.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

36 / 40

36.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

37 / 40

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

38 / 40

38.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

39 / 40

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

 

40 / 40

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

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.