[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

4. Python can be install on both  Linux and  Windows

5 / 40

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

6 / 40

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

7 / 40

7.

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

8 / 40

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

9 / 40

9.

How to copy one list to another in python?

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

10 / 40

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

11 / 40

11.

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

12 / 40

12.

What is the value of the expression 100 / 25?

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

13 / 40

13.

What will be the output of above Python code?

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

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

14 / 40

14. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

15 / 40

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

16 / 40

16. An array is a special variable, which can hold more than one value at a time

17 / 40

17. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

18 / 40

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

19 / 40

19. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

20 / 40

20.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

21 / 40

21.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

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. Python will give you an error if you skip the indentation

24 / 40

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

25 / 40

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

26 / 40

26.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

27 / 40

27.

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

a. True

b. False

28 / 40

28.

 ____________________ 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

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.

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

32 / 40

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

33 / 40

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

34 / 40

34.

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

35 / 40

35. Python is an interpreted programming language

36 / 40

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

37 / 40

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

38 / 40

38. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

39 / 40

39.

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.

40 / 40

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

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.