[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

2 / 40

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

3 / 40

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

4 / 40

4.

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

5 / 40

5. python has two primitive loop commands:

  • while loops
  • for loops

6 / 40

6.

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

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

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

11 / 40

11. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

12 / 40

12.

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

13 / 40

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

14 / 40

14. A variable name must start with a letter or the underscore character

15 / 40

15.

Which function overloads the >> operator?

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

16 / 40

16. Python relies on indentation?

17 / 40

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

18 / 40

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

19 / 40

19.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

20 / 40

20. To insert characters that are illegal in a string, use an escape character

21 / 40

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

22 / 40

22.

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28.

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

a. Define

b. DEF

c. def

d. Def

29 / 40

29. Comments starts with a #

30 / 40

30.

What will be the output of above Python code?

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

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

31 / 40

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

32 / 40

32.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

37 / 40

37. Variables that are created outside of a function

38 / 40

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

39 / 40

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

40 / 40

40. Extension of all Python  Programme are .py

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.