[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

What will be the output of above Python code?

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

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

2 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

3 / 40

3.

What is the value of the expression 100 / 25?

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

4 / 40

4. Is there any comments in  following codes

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

 

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

9.

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

10 / 40

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

11 / 40

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

12 / 40

12.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

13 / 40

13. Python has various versions available

14 / 40

14. Python can be install on both  Linux and  Windows

15 / 40

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

16 / 40

16.

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

a. Define

b. DEF

c. def

d. Def

17 / 40

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

18 / 40

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

19 / 40

19. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

20 / 40

20. python file can also run on command line

21 / 40

21.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

22 / 40

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

23 / 40

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

24 / 40

24.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

25 / 40

25. Comparison operators are not  used to compare two values

26 / 40

26.

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

27 / 40

27.

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

28 / 40

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

29 / 40

29. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

30 / 40

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

31 / 40

31. Variable names are case-sensitive

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36.

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

a. 2

b. 3

c. 5

d. Multiple times

37 / 40

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

 

38 / 40

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

39 / 40

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

40 / 40

40. A variable name cannot start with a number

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.