[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 loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

2 / 40

2.

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

3 / 40

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

4 / 40

4. A variable name cannot start with a number

5 / 40

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

6 / 40

6. Extension of all Python  Programme are .py

7 / 40

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

8 / 40

8. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

9 / 40

9.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

10 / 40

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

11 / 40

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

 

12 / 40

12. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

13 / 40

13.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

14 / 40

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

15 / 40

15. Most recent major version of Python is Python 3

16 / 40

16. The format() method takes unlimited number of arguments

17 / 40

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

18 / 40

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

19 / 40

19.

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

20 / 40

20. You can return a range of characters by using the slice syntax

21 / 40

21. Arithmetic operators are used with numeric values to perform common mathematical operations

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

26 / 40

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

27 / 40

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

a. 5

b. 3

c. 6

d. 7

28 / 40

28. Comments starts with a #

29 / 40

29.

What is the value of the expression 100 / 25?

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

30 / 40

30. Comments can be used to explain Python code.

31 / 40

31. The else keyword catches anything which isn’t caught by the preceding conditions.

32 / 40

32.

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

a. 2

b. 3

c. 5

d. Multiple times

33 / 40

33.

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

34 / 40

34.

 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.

35 / 40

35. Operators are used to perform operations on variables and values

36 / 40

36.

 What is output of: 35 == 35.0

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

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.