[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

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

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

3 / 40

3. Variables that are created outside of a function

4 / 40

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

5 / 40

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

6 / 40

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

 

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

11 / 40

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

12 / 40

12.

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

a. Define

b. DEF

c. def

d. Def

13 / 40

13. Variable names are case-sensitive

14 / 40

14.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

15 / 40

15.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

16 / 40

16.

Which function overloads the >> operator?

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

17 / 40

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

18 / 40

18. python has two primitive loop commands:

  • while loops
  • for loops

19 / 40

19.

What will be the output of above Python code?

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

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

20 / 40

20. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

21 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

22 / 40

22.

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

23 / 40

23. Python allows you to extract the values into variables.

24 / 40

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

25 / 40

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

26 / 40

26. Comparison operators are not  used to compare two values

27 / 40

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

28 / 40

28.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

29 / 40

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

30 / 40

30. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

31 / 40

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

32 / 40

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

33 / 40

33.

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

34 / 40

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

35 / 40

35. 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))

36 / 40

36. Who developed Python Programming Language?

37 / 40

37. Extension of all Python  Programme are .py

38 / 40

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

39 / 40

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

40 / 40

40. The len() method to return the length of an array

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.