Back to Browse

Datatypes in Python Programming (Hindi)

410 views
Jun 23, 2020
13:11

#Python #Datatypes #RemoteLearning Data types are used to identify the type of data and set of valid operations which can be performed on it. Python has following data types: Numbers String List Tuple Dictionary Data types offered by python to store and process different type of numeric data Integers (int) stores big or small and signed or unsigned integers where as Boolean (True or False) Floating Point Numbers Represents double precision floating point numbers (15 digit precision) Python represents Complex Numbers in the form A + Bj Where, A & B are Real Numbers and j = √-1 (imaginary) Real and imaginary part are internally represented as a pair of floating point numbers (float) In Python 3.x, all strings are a sequence of pure Unicode* Characters and each character can be individually accessed using its index A string can hold any known character like letters, numbers, special characters etc., of any known scripted language E.g. “abcd”, “$@&%”, ‘???’, “1234”, “αβγ”, “प्रोग्रामिंग”, “ਪ੍ਰੋਗਰਾਮਿੰਗ”, “程式设计” A list in Python is represented as a group of comma-separated values of any datatype enclosed in square brackets. E.g. [1,2,3,4,5], [‘Ankit’, 101, 90.5], [‘a’, ‘e’, ‘i’, ‘o’, ‘u’] Elements in a List can be individually accessed using its index A tuple in Python is represented as a group of comma-separated values of any datatype enclosed within parentheses. E.g. A=(1,2,3,4,5), R=(‘Ankit’, 101, 90.5), V=(‘a’, ‘e’, ‘i’, ‘o’, ‘u’) Elements in a Tuple can be individually accessed using its index (Negative or Positive) The dictionary in Python is an unordered set of comma-separated key:value pair enclosed within curly braces. E.g. vowels ={‘a’:1, ‘e’:2, ‘i’:3, ‘o’:4, ‘u’:5} Where, ‘a’, ‘e’, ‘i’, ‘o’, ‘u’ are the keys of dictionary vowels & 1,2,3,4,5 are the values for these keys respectively References: Preeti Arora, “Computer Science with Python (Textbook of CBSE Class XII)”, Sultan Chand & Sons, 2020 Sumita Arora, “Computer Science with Python (Textbook of CBSE Class XII)”, Dhanpat Rai & Co., 2020

Download

0 formats

No download links available.

Datatypes in Python Programming (Hindi) | NatokHD