[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

3 / 40

3.

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

a. Define

b. DEF

c. def

d. Def

4 / 40

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

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.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10. Variable names are case-sensitive

11 / 40

11. With the break statement we can stop the loop before it has looped through all the items

12 / 40

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

13 / 40

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

14 / 40

14. The format() method takes the passed arguments

15 / 40

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

16 / 40

16.

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

a. 2

b. 3

c. 5

d. Multiple times

17 / 40

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

18 / 40

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

19 / 40

19. A variable name cannot start with a number

20 / 40

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

21 / 40

21.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

22 / 40

22.

What will be the output of below Python code?

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

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

23 / 40

23.

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

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

24 / 40

24. Python can be install on both  Linux and  Windows

25 / 40

25. Python relies on indentation?

26 / 40

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

27 / 40

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

28 / 40

28.

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

29 / 40

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

30 / 40

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

a. 5

b. 3

c. 6

d. 7

31 / 40

31. Python is a  high-level programming language.

32 / 40

32.

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

a. [ ]

b. { }

c. ( )

d. None of the above

33 / 40

33. python has two primitive loop commands:

  • while loops
  • for loops

34 / 40

34. You can also have an else without the elif

35 / 40

35. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

36 / 40

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

37 / 40

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

38 / 40

38.

 What is output of: 35 == 35.0

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

39 / 40

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

40 / 40

40. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

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

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.