[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. What is the output of the given below program?

if 3 + 4 == 7:    print("Hi")else:    print("Know Program")print("Hello")

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

2 / 40

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

3 / 40

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

4 / 40

4.

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

a. True

b. False

5 / 40

5.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

6 / 40

6. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

7 / 40

7. You can also have an else without the elif

8 / 40

8. Variables that are created outside of a function

9 / 40

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

10 / 40

10.

What will be the output of above Python code?

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

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

11 / 40

11. Python is an interpreted programming language

12 / 40

12. A variable name cannot start with a number

13 / 40

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

a. 5

b. 3

c. 6

d. 7

14 / 40

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

15 / 40

15. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

16 / 40

16. With the break statement we can stop the loop before it has looped through all the items

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21.

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.

22 / 40

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

23 / 40

23.

What will be the output of below Python code?

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

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

24 / 40

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

25 / 40

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

26 / 40

26. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

27 / 40

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

28 / 40

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

29 / 40

29.

Which function overloads the >> operator?

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

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37. Comments can be used to explain Python code.

38 / 40

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

39 / 40

39. Python can connect to database systems.

40 / 40

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

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.