[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

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

3 / 40

3. Comments can be used to explain Python code.

4 / 40

4.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

5 / 40

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

a. 5

b. 3

c. 6

d. 7

6 / 40

6. python file can also run on command line

7 / 40

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

8 / 40

8.

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

9 / 40

9. Strings in python are surrounded by either single quotation marks, or double quotation marks

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. With the break statement we can stop the loop before it has looped through all the items

12 / 40

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

13 / 40

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

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. We can combine strings and numbers by using the format() method

16 / 40

16.

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

17 / 40

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

18 / 40

18. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

19 / 40

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

20 / 40

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

21 / 40

21.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

22 / 40

22. Camel Case
Each word, except the first, starts with a capital letter:

23 / 40

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

24 / 40

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

25 / 40

25.

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

26 / 40

26. Variables that are created outside of a function

27 / 40

27. You can also have an else without the elif

28 / 40

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

29 / 40

29. During Installation Make sure to select both the checkboxes at the bottom .

30 / 40

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

31 / 40

31. A variable name cannot start with a number

32 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

33 / 40

33.

 What is output of: 35 == 35.0

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

34 / 40

34. Comparison operators are not  used to compare two values

35 / 40

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

36 / 40

36.

How to copy one list to another in python?

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

37 / 40

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

38 / 40

38.

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

a. [ ]

b. { }

c. ( )

d. None of the above

39 / 40

39. Who developed Python Programming Language?

40 / 40

40. python has two primitive loop commands:

  • while loops
  • for loops

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.