[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

9.

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.

10 / 40

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

11 / 40

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

12 / 40

12. Bitwise operators are used to compare (binary) numbers

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17. With the break statement we can stop the loop before it has looped through all the items

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21.

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

22 / 40

22.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

23 / 40

23. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

24 / 40

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

25 / 40

25.

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.

26 / 40

26.

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

27 / 40

27. Python has various versions available

28 / 40

28. Most recent major version of Python is Python 3

29 / 40

29.

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

30 / 40

30.

 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.

31 / 40

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

32 / 40

32.

What is the value of the expression 100 / 25?

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

33 / 40

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

34 / 40

34. We can combine strings and numbers by using the format() method

35 / 40

35. Python is an interpreted programming language

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39. Who developed Python Programming Language?

40 / 40

40.

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

a. Define

b. DEF

c. def

d. Def

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.