[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

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.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

4 / 40

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

5 / 40

5. Python relies on indentation?

6 / 40

6.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

7 / 40

7.

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

8 / 40

8.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

9 / 40

9.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

10 / 40

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

11 / 40

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

12 / 40

12. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

13 / 40

13. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

14 / 40

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

15 / 40

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

16 / 40

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

a. 5

b. 3

c. 6

d. 7

17 / 40

17.

 ____________________ 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

18 / 40

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

19 / 40

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

20 / 40

20.

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

21 / 40

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

22 / 40

22.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

23 / 40

23. A variable name can only contain alpha-numeric characters and
underscores

24 / 40

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

25 / 40

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

26 / 40

26. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

27 / 40

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

28 / 40

28.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

29 / 40

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

30 / 40

30. Variable names are case-sensitive

31 / 40

31. python has two primitive loop commands:

  • while loops
  • for loops

32 / 40

32. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

33 / 40

33.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

34 / 40

34. Python is a  high-level programming language.

35 / 40

35. The list’s remove() method only removes the first occurrence of the specified value.

36 / 40

36.

What will be the output of below Python code?

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

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

37 / 40

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

38 / 40

38.

Which function overloads the >> operator?

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

39 / 40

39. Arithmetic operators are used with numeric values to perform common mathematical operations

40 / 40

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

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.