+ 10
If we have a string and numeric value too in an array then , if we print that array then output array will be string or of mixed
Related to python
5 odpowiedzi
+ 10
The numpy array will not be of number or mixed type it will be of string type
A=np.array(["yash","harsh",1])
print(A)
So output will be
["yash","harsh","1"]
string type
+ 7
The type (str, int, etc.) of an element in a list won't change if we print the list.
lst = ["hello", "world", 42]
print(lst)
print(type(lst))
print([type(i) for i in lst])
Output:
['hello', 'world', 42]
<class 'list'>
[<class 'str'>, <class 'str'>, <class 'int'>]
+ 3
An Array can store elements of one type only!!
+ 2
omg
+ 2
Nice question