[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

5.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

6 / 40

6. The list’s remove() method only removes the first occurrence of the specified value.

7 / 40

7.

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.

8 / 40

8.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

9 / 40

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

10 / 40

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

11 / 40

11.

How to copy one list to another in python?

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

12 / 40

12.

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

a. Define

b. DEF

c. def

d. Def

13 / 40

13. Who developed Python Programming Language?

14 / 40

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

15 / 40

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

16 / 40

16. Python can connect to database systems.

17 / 40

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

18 / 40

18. A variable name must start with a letter or the underscore character

19 / 40

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

 

20 / 40

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

21 / 40

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

22 / 40

22.

 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.

23 / 40

23. What is the output of the given below program?

if 3 + 4 == 7:    print("Hi")else:    print("Know Program")print("Hello")

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

24 / 40

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

25 / 40

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

26 / 40

26.

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

27 / 40

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

28 / 40

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

29 / 40

29.

 ____________________ 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

30 / 40

30. Python has various versions available

31 / 40

31.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

32 / 40

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

33 / 40

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

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

34 / 40

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

35 / 40

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

36 / 40

36. Is there any comments in  following codes

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

 

37 / 40

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

38 / 40

38.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

39 / 40

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

40 / 40

40.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

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.