[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

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

a. Define

b. DEF

c. def

d. Def

3 / 40

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

4 / 40

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

5 / 40

5. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

6 / 40

6.

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

11. You can also have an else without the elif

12 / 40

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

13 / 40

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

14 / 40

14. Comparison operators are not  used to compare two values

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

19. The for loop does not require an indexing variable to set beforehand

20 / 40

20. Python is a  high-level programming language.

21 / 40

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

22 / 40

22.

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

23 / 40

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

24 / 40

24.

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

25 / 40

25. A variable name can only contain alpha-numeric characters and
underscores

26 / 40

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

27 / 40

27. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

28 / 40

28. Variables that are created outside of a function

29 / 40

29.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

30 / 40

30. The format() method takes the passed arguments

31 / 40

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

32 / 40

32.

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

33 / 40

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

34 / 40

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

35 / 40

35.

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

36 / 40

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

37 / 40

37.

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.

38 / 40

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

39 / 40

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

40 / 40

40.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

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.