what is the output of the following L = [None]*10 print (len (L))
Answers
Answered by
3
This includes higher level python
Let's start
The answer is
10
Answered by
0
Output is syntax error.
L = [None]*10
print (len (L))
- In python "None" does not represent 0 or empty string. There is a seperate datatype for "None" called "None".
- Hence print cannot accept the argument type None since it does not support the data type. It can accept only data types like integer, float, string, char etc.
- The python compiler shows the output "invalid nonprintable character 200B".
- In the first line of code, an array L is created and initialised with None datatype.
- In second line, len() is used to calculate the length of array.
- However, print() cannot display either array L or length of the array L.
- To initiate the empty aarray we can use, L=[0]*10 print(len(L)). This code produces output 10.
- Hence, the output is syntax error.
#SPJ3
Similar questions