[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. The length of an array is always one more than the highest array index.

2 / 40

2. The format() method takes the passed arguments

3 / 40

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

4 / 40

4. Variable names are case-sensitive

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12.

Which is the correct operator for power(xy)?

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

13 / 40

13.

Which function overloads the >> operator?

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

14 / 40

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

15 / 40

15. Python is a  high-level programming language.

16 / 40

16. Python has a set of built-in methods that you can use on lists/arrays

17 / 40

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

18 / 40

18.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

19 / 40

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

20 / 40

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

21 / 40

21. An array can hold many values under a single name

22 / 40

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

23 / 40

23. What will be the output of the following Python code?

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

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.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

26 / 40

26.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

27 / 40

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

 

28 / 40

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

29 / 40

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

30 / 40

30. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

31 / 40

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

32 / 40

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

33 / 40

33. Python can be install on both  Linux and  Windows

34 / 40

34. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

35 / 40

35. You can also have an else without the elif

36 / 40

36. Python can be treated in a procedural way, an object-oriented way or a functional way.

37 / 40

37. Python relies on indentation?

38 / 40

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

39 / 40

39. python file can also run on command line

40 / 40

40. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

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.