[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

a. 5

b. 3

c. 6

d. 7

3 / 40

3.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

4 / 40

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

5 / 40

5. Python has various versions available

6 / 40

6.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

7 / 40

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

8 / 40

8. With the break statement we can stop the loop even if the while condition is true

9 / 40

9.

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

10 / 40

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

11 / 40

11.

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

12 / 40

12. Python can connect to database systems.

13 / 40

13. Python can be install on both  Linux and  Windows

14 / 40

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

15 / 40

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

16 / 40

16. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

17 / 40

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

18 / 40

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

19 / 40

19. A variable name must start with a letter or the underscore character

20 / 40

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

21 / 40

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

22 / 40

22.

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

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

23 / 40

23. Variables that are created outside of a function

24 / 40

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

 

25 / 40

25. Variable names are case-sensitive

26 / 40

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

27 / 40

27.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

28 / 40

28.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

29 / 40

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

30 / 40

30.

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

31 / 40

31. Who developed Python Programming Language?

32 / 40

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

33 / 40

33. python file can also run on command line

34 / 40

34.

 ____________________ 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

35 / 40

35. python has two primitive loop commands:

  • while loops
  • for loops

36 / 40

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

37 / 40

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

38 / 40

38. To insert characters that are illegal in a string, use an escape character

39 / 40

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

40 / 40

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

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.