[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 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

2 / 40

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

3 / 40

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

4 / 40

4. Who developed Python Programming Language?

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

8.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

9 / 40

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

10 / 40

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

11 / 40

11. Strings in python are surrounded by either single quotation marks, or double quotation marks

12 / 40

12. You can have if statements inside if statements, this is called nested if statements.

13 / 40

13.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

14 / 40

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

15 / 40

15.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

16 / 40

16. Extension of all Python  Programme are .py

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21.

What will be the output of above Python code?

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

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

22 / 40

22.

Which function overloads the >> operator?

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

23 / 40

23. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

24 / 40

24.

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

a. Define

b. DEF

c. def

d. Def

25 / 40

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

26 / 40

26.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

27 / 40

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

28 / 40

28. Is there any comments in  following codes

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

 

29 / 40

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

30 / 40

30. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

31 / 40

31.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

32 / 40

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

33 / 40

33. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37.

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

38 / 40

38. Python has various versions available

39 / 40

39.

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

a. [ ]

b. { }

c. ( )

d. None of the above

40 / 40

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

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.