[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python allows you to extract the values into variables.

2 / 40

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

3 / 40

3. Python has a set of built-in methods that you can use on lists/arrays

4 / 40

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

5 / 40

5.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

6 / 40

6. Python is a  high-level programming language.

7 / 40

7.

 ____________________ 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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

11.

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

12 / 40

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

13 / 40

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

14 / 40

14. Most recent major version of Python is Python 3

15 / 40

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

16 / 40

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

17 / 40

17.

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

18 / 40

18.

What is the value of the expression 100 / 25?

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

19 / 40

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

20 / 40

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

21 / 40

21.

What will be the output of below Python code?

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

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

22 / 40

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

23 / 40

23.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

24 / 40

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

25 / 40

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

26 / 40

26. The format() method takes the passed arguments

27 / 40

27. Python relies on indentation?

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. An array is a special variable, which can hold more than one value at a time

30 / 40

30.

Which is the correct operator for power(xy)?

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

31 / 40

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

32 / 40

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

33 / 40

33. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

34 / 40

34.

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

a. 2

b. 3

c. 5

d. Multiple times

35 / 40

35.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

36 / 40

36.

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

37 / 40

37. You can have if statements inside if statements, this is called nested if statements.

38 / 40

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

39 / 40

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

40 / 40

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

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.