[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Variables that are created outside of a function

2 / 40

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

3 / 40

3. Official site of python is www.python.org

4 / 40

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

5 / 40

5.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

6 / 40

6. Python has various versions available

7 / 40

7. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

8 / 40

8.

What will be the output of above Python code?

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

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

9 / 40

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

10 / 40

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

11 / 40

11.

 ____________________ 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

12 / 40

12. Python can connect to database systems.

13 / 40

13. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

14 / 40

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

15 / 40

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

16 / 40

16. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

17 / 40

17.

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

18 / 40

18. Python is a  high-level programming language.

19 / 40

19.

What will be the output of below Python code?

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

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

20 / 40

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

21 / 40

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

22 / 40

22. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26.

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

27 / 40

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

28 / 40

28. Arrays are used to store multiple values in one single variable.

29 / 40

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

30 / 40

30.

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

31 / 40

31.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

32 / 40

32. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

33 / 40

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

34 / 40

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

35 / 40

35.

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

36 / 40

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

37 / 40

37. Snake Case
Each word is separated by an underscore character:

38 / 40

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

39 / 40

39. Is there any comments in  following codes

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

 

40 / 40

40.

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

a. [ ]

b. { }

c. ( )

d. None of the above

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.