[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

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.

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

7. python has two primitive loop commands:

  • while loops
  • for loops

8 / 40

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

9 / 40

9. Is there any comments in  following codes

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

 

10 / 40

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

11 / 40

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

12 / 40

12.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

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. python file can also run on command line

15 / 40

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

16 / 40

16.

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20.

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

a. True

b. False

21 / 40

21.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

22 / 40

22. Python can connect to database systems.

23 / 40

23. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

24 / 40

24. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

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. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

27 / 40

27. Python can be install on both  Linux and  Windows

28 / 40

28. Comments starts with a #

29 / 40

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

30 / 40

30.

What will be the output of below Python code?

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

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

31 / 40

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

32 / 40

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

33 / 40

33.

Which function overloads the >> operator?

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38.

What will be the output of above Python code?

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

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

39 / 40

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

40 / 40

40. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

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.