[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Pip is  not a powerful package management system for Python software packages

3 / 40

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

4 / 40

4. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

5 / 40

5. The for loop does not require an indexing variable to set beforehand

6 / 40

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

7 / 40

7. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

8 / 40

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

9 / 40

9.

 What is output of: 35 == 35.0

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

10 / 40

10. python has two primitive loop commands:

  • while loops
  • for loops

11 / 40

11.

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

12 / 40

12. Python is an interpreted programming language

13 / 40

13. The format() method takes the passed arguments

14 / 40

14.

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

15 / 40

15.

What will be the output of below Python code?

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

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

16 / 40

16. python file can also run on command line

17 / 40

17. Comparison operators are not  used to compare two values

18 / 40

18. A variable name cannot start with a number

19 / 40

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

20 / 40

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

21 / 40

21.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

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. Arithmetic operators are used with numeric values to perform common mathematical operations

24 / 40

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

25 / 40

25.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

26 / 40

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

27 / 40

27. Variable names are case-sensitive

28 / 40

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

29 / 40

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

30 / 40

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

a. 5

b. 3

c. 6

d. 7

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

35.

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.

36 / 40

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

37 / 40

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

 

38 / 40

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

39 / 40

39.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

40 / 40

40. Arrays are used to store multiple values in one single variable.

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.