GOVERNMENT POLYTECHNIC MUZFFAR MENTORSHIP – PROF. NAIYER HODA Presented by :- sonam priya Branch :- computer sc. & engineering Roll No. :- 2024-cse-47 Data type in python
Data types in python :- A data type represents the type of data stored into a variable or memory . Some of the basic data types are :- Numeric type Sequences Sets Dictionary boolean
Python Data Type
Numeric Data type :- Integer :- Integer are whole numbers without a decimal point. e.g :- age = 17 X = 49 Float :- It represents real numbers with a decimal point . e.g :- pi = 3.14 y = 7.0 Complex :- It represent complex numbers e.g :- a = 6 + 4j b = I - 2
Boolean Data Types :- The Boolean data type is one of the simplest data types in programming It contain only two type :- True False e.g :- is 7 equal to 7 = True Is 4 equal to 5 = False
Sequence Data Type :- Strings:-Strings are sequences of Characters enclosed in single ०४ double quote List:-List are ordered collections pair of items enclosed with in a of square brackets. The items in a list can be same or of different data types. eg :- student_names = [' ankit ', 'ram', 'Sono“] List are mutable ie . we can change the contents of list after its creation.
Tuple:-Tuples are ordered collection similar to lists, but they are immutable i.e. you cannot change the contents after its creation. e.g. - Student-scores = (85,92,46 )
Dictionary :- Dictionary :- Dictionary are collection of Key-value pairs. The Key of a dictionary should be unique and they map to corresponding value. eg : - Student-info = $ 1: amit ', 2: ' govind ' →3:"Ram’) Set :- Set :- A set is a collection which is unordered and unindexed. e.g.- fruit f'apple ', 'guava', 'banana'"}