[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

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

3 / 40

3. Python is an interpreted programming language

4 / 40

4.

 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.

5 / 40

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

6 / 40

6.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

7 / 40

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

8 / 40

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

9 / 40

9. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

10 / 40

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

11 / 40

11. Who developed Python Programming Language?

12 / 40

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

13 / 40

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

14 / 40

14.

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

15 / 40

15. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

23. Python can be install on both  Linux and  Windows

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28.

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

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

29 / 40

29. python has two primitive loop commands:

  • while loops
  • for loops

30 / 40

30.

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

a. Define

b. DEF

c. def

d. Def

31 / 40

31.

 What is output of: 35 == 35.0

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

32 / 40

32.

Which function overloads the >> operator?

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

33 / 40

33.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

34 / 40

34.

 ____________________ 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

35 / 40

35. You can use the append() method to add an element to an array

36 / 40

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

37 / 40

37.

Which is the correct operator for power(xy)?

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

38 / 40

38.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

39 / 40

39. Comments starts with a #

40 / 40

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

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.