[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

 ____________________ 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

3 / 40

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

4 / 40

4.

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

5 / 40

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

6 / 40

6. Variable names are case-sensitive

7 / 40

7. Pascal Case
Each word starts with a capital letter:

8 / 40

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

9 / 40

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

10 / 40

10.

What is the value of the expression 100 / 25?

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

11 / 40

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

12 / 40

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

13 / 40

13. The for loop does not require an indexing variable to set beforehand

14 / 40

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

15 / 40

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

16 / 40

16. What will be the output of the following Python code?

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

17 / 40

17. Variables that are created outside of a function

18 / 40

18. The format() method takes the passed arguments

19 / 40

19.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

24. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

25 / 40

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

26 / 40

26. Is there any comments in  following codes

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

 

27 / 40

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

28 / 40

28.

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

29 / 40

29.

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.

30 / 40

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

31 / 40

31. With the for loop we can execute a set of statements

32 / 40

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

33 / 40

33.

Which function overloads the >> operator?

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

34 / 40

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

35 / 40

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

36 / 40

36.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

37 / 40

37.

 What is output of: 35 == 35.0

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

38 / 40

38.

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

39 / 40

39.

What will be the output of below Python code?

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

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

40 / 40

40.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. 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.