[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

3 / 40

3.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

4 / 40

4.

What is the data type of print(type(0xFF))

5 / 40

5.

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

a. [ ]

b. { }

c. ( )

d. None of the above

6 / 40

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

7 / 40

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

8 / 40

8. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

9 / 40

9. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

10 / 40

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

11 / 40

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

12 / 40

12. The for loop does not require an indexing variable to set beforehand

13 / 40

13. You can use the pop() method to remove an element from the array

14 / 40

14. python file can also run on command line

15 / 40

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

16 / 40

16. Extension of all Python  Programme are .py

17 / 40

17.

What is the data type of print(type(10))

18 / 40

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

19 / 40

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

20 / 40

20.

What will be the output of above Python code?

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

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

21 / 40

21. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26.

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.

27 / 40

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

28 / 40

28.

 What is output of: 35 == 35.0

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

29 / 40

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

30 / 40

30.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

31 / 40

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

32 / 40

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

33 / 40

33. Python is an interpreted programming language

34 / 40

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

35 / 40

35.

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

a. True

b. False

36 / 40

36.

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

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

37 / 40

37.

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

38 / 40

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

39 / 40

39. You can also have an else without the elif

40 / 40

40.

Which is the correct operator for power(xy)?

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

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.