Computer Science, asked by anxietylil10, 5 months ago

Can you identify the data types of following values,if yes write their data type. [4,5,2] , {2,34,5} , (4,23,55) , {33,4,4} , 4, 5.2, 8j , ’1’ , ”1” , 4+0j

Answers

Answered by Equestriadash
27

1. [4, 5, 2] - list.

2. {2, 34, 5} - dictionary.

3. (4, 23, 55) - tuple.

4. {33, 4, 4} -  dictionary.

5. 4 - integer.

6. 5.2 - float.

7. 8j - complex.

8. '1' - string.

9. "1" - string.

10. 4 + 0j - complex.

  • Lists are a collection of elements, that can consist of any data type with. They're normally enclosed in square brackets. They're mutable.

  • Dictionaries are a collection of unordered, changeable elements. They're normally enclosed in curly brackets.

  • Tuples are a collection of elements, similar to lists, but are enclosed in parenthesis. They're immutable.

  • Integers are values ranging from negative to positive.

  • Strings are characters, a sequence of characters enclosed in quotes.

  • Complex values are values that take up imaginary, uneasy values.
Similar questions