[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Python has various versions available

3 / 40

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

4 / 40

4.

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

5 / 40

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

6 / 40

6. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

7 / 40

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

8 / 40

8. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

9 / 40

9. We can combine strings and numbers by using the format() method

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14. Comments starts with a #

15 / 40

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

16 / 40

16.

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

17 / 40

17. Comments can be used to make the code more readable.

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21. print() function is often used to output variables.

22 / 40

22.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

23 / 40

23. You can use the pop() method to remove an element from the array

24 / 40

24. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28. An array is a special variable, which can hold more than one value at a time

29 / 40

29.

 What is output of: 35 == 35.0

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

30 / 40

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

31 / 40

31.

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

32 / 40

32.

 ____________________ 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

33 / 40

33.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

34 / 40

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

35 / 40

35. A variable name cannot start with a number

36 / 40

36.

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

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40.

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

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.