[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

What will be the output of below Python code?

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

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

2 / 40

2. You can return a range of characters by using the slice syntax

3 / 40

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

4 / 40

4.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

5 / 40

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

6 / 40

6. An array can hold many values under a single name

7 / 40

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

8 / 40

8.

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

9 / 40

9. Who developed Python Programming Language?

10 / 40

10.

Which is the correct operator for power(xy)?

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

11 / 40

11.

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

a. 2

b. 3

c. 5

d. Multiple times

12 / 40

12.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

13 / 40

13.

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

a. Define

b. DEF

c. def

d. Def

14 / 40

14.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

15 / 40

15. Most recent major version of Python is Python 3

16 / 40

16.

 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.

17 / 40

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

18 / 40

18.

How to copy one list to another in python?

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

19 / 40

19.

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

20 / 40

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

21 / 40

21.

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

22 / 40

22. Is there any comments in  following codes

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

 

23 / 40

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

24 / 40

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

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

25 / 40

25.

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

a. True

b. False

26 / 40

26. Python can be treated in a procedural way, an object-oriented way or a functional way.

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30. Python relies on indentation?

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

35.

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

36 / 40

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

37 / 40

37. A variable name cannot start with a number

38 / 40

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

39 / 40

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

40 / 40

40.

What will be the output of above Python code?

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

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

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.