[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

4. Python is a  high-level programming language.

5 / 40

5. The len() method to return the length of an array

6 / 40

6. You can use the append() method to add an element to an array

7 / 40

7. python has two primitive loop commands:

  • while loops
  • for loops

8 / 40

8. python file can also run on command line

9 / 40

9. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

10 / 40

10.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

11 / 40

11.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

16. A variable name cannot start with a number

17 / 40

17.

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

18 / 40

18. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

19 / 40

19.

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.

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. Python relies on indentation?

22 / 40

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

23 / 40

23. Python has various versions available

24 / 40

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

25 / 40

25. Comments can be used to explain Python code.

26 / 40

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

27 / 40

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

28 / 40

28.

What will be the output of below Python code?

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

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

29 / 40

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

30 / 40

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

31 / 40

31.

 What is output of: 35 == 35.0

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

32 / 40

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

33 / 40

33. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

34 / 40

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

35 / 40

35. Extension of all Python  Programme are .py

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. Is there any comments in  following codes

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

 

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.