[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Comparison operators are not  used to compare two values

3 / 40

3. During Installation Make sure to select both the checkboxes at the bottom .

4 / 40

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

5 / 40

5.

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

6 / 40

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

7 / 40

7. Official site of python is www.python.org

8 / 40

8. With the break statement we can stop the loop even if the while condition is true

9 / 40

9.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

10 / 40

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

11 / 40

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

12 / 40

12.

How to copy one list to another in python?

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

13 / 40

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

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. Comments can be used to explain Python code.

16 / 40

16.

What will be the output of above Python code?

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

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

21 / 40

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

22 / 40

22.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

23 / 40

23.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

24 / 40

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

25 / 40

25. A variable name cannot start with a number

26 / 40

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

27 / 40

27.

 ____________________ 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

28 / 40

28. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

29 / 40

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

30 / 40

30.

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

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

31 / 40

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

32 / 40

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

33 / 40

33.

Which is the correct operator for power(xy)?

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

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.

What is the value of the expression 100 / 25?

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

36 / 40

36. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

37 / 40

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

38 / 40

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

39 / 40

39. The format() method takes the passed arguments

40 / 40

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

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.