[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

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

3 / 40

3. Extension of all Python  Programme are .py

4 / 40

4. You can also use the remove() method to remove an element from the array

5 / 40

5. python has two primitive loop commands:

  • while loops
  • for loops

6 / 40

6.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

7 / 40

7.

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.

8 / 40

8. Comments can be used to explain Python code.

9 / 40

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

10 / 40

10. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

15 / 40

15. Python has various versions available

16 / 40

16.

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

a. True

b. False

17 / 40

17. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

18 / 40

18. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22.

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.

23 / 40

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

24 / 40

24. Comments starts with a #

25 / 40

25. Variable names are case-sensitive

26 / 40

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

27 / 40

27.

What is the value of the expression 100 / 25?

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

28 / 40

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

29 / 40

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

30 / 40

30.

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

31 / 40

31. Who developed Python Programming Language?

32 / 40

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

33 / 40

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

34 / 40

34.

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

a. [ ]

b. { }

c. ( )

d. None of the above

35 / 40

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

36 / 40

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

37 / 40

37. Most recent major version of Python is Python 3

38 / 40

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

39 / 40

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

40 / 40

40.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

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.