[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

What is the data type of print(type(0xFF))

3 / 40

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

4 / 40

4. Extension of all Python  Programme are .py

5 / 40

5.

What is the value of the expression 100 / 25?

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

6 / 40

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

7 / 40

7. Python has various versions available

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

13 / 40

13. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

14 / 40

14.

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.

15 / 40

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

16 / 40

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

17 / 40

17. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

18 / 40

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

19 / 40

19.

What is the data type of print(type(10))

20 / 40

20.

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

21 / 40

21. python has two primitive loop commands:

  • while loops
  • for loops

22 / 40

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

23 / 40

23. Is there any comments in  following codes

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

 

24 / 40

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

25 / 40

25.

 ____________________ 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

26 / 40

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

27 / 40

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

28 / 40

28. The length of an array is always one more than the highest array index.

29 / 40

29.

What will be the output of below Python code?

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

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

30 / 40

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

31 / 40

31. Python allows you to extract the values into variables.

32 / 40

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

33 / 40

33. Comments can be used to make the code more readable.

34 / 40

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

35 / 40

35.

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

36 / 40

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

37 / 40

37.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

38 / 40

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

39 / 40

39. We can combine strings and numbers by using the format() method

40 / 40

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

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.