[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Variables that are created outside of a function

2 / 40

2. Comments starts with a #

3 / 40

3. python file can also run on command line

4 / 40

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

5 / 40

5. A variable name cannot start with a number

6 / 40

6.

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

7 / 40

7. The format() method takes the passed arguments

8 / 40

8.

What will be the output of above Python code?

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

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

9 / 40

9. Variable names are case-sensitive

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14. Pascal Case
Each word starts with a capital letter:

15 / 40

15.

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

16 / 40

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

17 / 40

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

18 / 40

18. Comparison operators are not  used to compare two values

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

23 / 40

23. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27.

 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.

28 / 40

28.

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

29 / 40

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

30 / 40

30.

Which is the correct operator for power(xy)?

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

31 / 40

31.

 What is output of: 35 == 35.0

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

32 / 40

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

33 / 40

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

34 / 40

34. Comments can be used to explain Python code.

35 / 40

35. You can also have an else without the elif

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39.

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

40 / 40

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

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.