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

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

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

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

5.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

6 / 40

6. Comparison operators are not  used to compare two values

7 / 40

7.

What will be the output of below Python code?

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

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

8 / 40

8.

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

9 / 40

9. python has two primitive loop commands:

  • while loops
  • for loops

10 / 40

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

11 / 40

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

12 / 40

12. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

13 / 40

13.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

14 / 40

14.

What will be the output of above Python code?

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

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

15 / 40

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

16 / 40

16. python file can also run on command line

17 / 40

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

18 / 40

18. Python can be install on both  Linux and  Windows

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

24. The format() method takes the passed arguments

25 / 40

25.

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

26 / 40

26. You can also have an else without the elif

27 / 40

27. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

28 / 40

28. Python can connect to database systems.

29 / 40

29.

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

30 / 40

30.

 ____________________ 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

31 / 40

31.

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

32 / 40

32.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

33 / 40

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

34 / 40

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

35 / 40

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

 

36 / 40

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

37 / 40

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

38 / 40

38. Python is an interpreted programming language

39 / 40

39. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

40 / 40

40.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

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.