Full Transcript

Python Programming Mak(Prof. KIM) Types of Data A303 010 6201 2453 [email protected] 1 01. Types of data available in Python All programs process data Data used in programming are classified into data types...

Python Programming Mak(Prof. KIM) Types of Data A303 010 6201 2453 [email protected] 1 01. Types of data available in Python All programs process data Data used in programming are classified into data types according to the type Most basic data types in programming: integers, float, strings 02. Numerical Type: Integer, Float, Complex Numerical data can perform arithmetic operations 02. Numerical Type: Integer, Float, Complex >>> x = 1 + 2j >>> print(x) (1+2j) >>>type(x) >>>complex(1.2, -1.3) (1.2-1.3j) 03. String String : sequence of characters Using ‘ ‘ or “ " 03. String 03. String Why do you use both large and small quotes? 04. Data Type Conversion The input( ) returns the data entered by the user in the form of a string 04. Data Type Conversion 04. Data Type Conversion 05. String Processing 05. String Processing 05. String Processing 05. String Processing Using ‘‘‘ 05. String Processing 9/3/20XX 프레젠테이션 제목 16 Python provides several built-in data types to handle various kinds of data. Here’s an overview of the most comm 1.Integer (int : Represents whole numbers, both positive and negative, without a decimal point. Example: 42 -7 ) ,. 2.Float (float : Represents real numbers, containing a decimal point. Example: 3.14 -0.001 ) ,. 3.String (str : Represents sequences of characters, used for text. Strings are enclosed in either single quotes (' ) ) or do 4.Boolean (bool : Represents two values: True False ) or. Used for logical operations and comparisons. 5.List (list : A collection of items that are ordered and changeable. Lists are defined using square brackets ([] ) ), and items can b 6.Tuple (tuple : Similar to a list, but tuples are immutable (unchangeable). Defined using parentheses (() (1, 2, 3) ('app ) ). Example: , 7.Dictionary (dict : A collection of key-value pairs. Each key is unique, and keys are used to retrieve the correspo ) 8.Set (set : An unordered collection of unique items. Sets are defined using curly braces ({} set() ) {1, 2, 3} {'apple', 'banan ) or the function. Example: , 9.NoneType (None : Represents the absence of a value or a null value. The None ) NoneType x = None keyword is used to define a object. Example:. These data types are fundamental to working with data in Python, and understanding them is crucial for writing e 9/3/20XX 프레젠테이션 제목 17 Lab. 01 Calculation of a Polynomial x=-1, y=3일 때, (-y)3+2x2y의 값을 계산하여 출력하는 프로그램 Lab. 05 Greenwich Mean Time - World Time Reference Point 유튜브 - 시간순삭파이썬 3장 LAB 5 설정 - 자막 – 한국어 자동생성 - 자막 - 자동번역 - 네팔어 Problems Answers 21 22 23 Thank you! See you next time. Mak(Prof. KIM) A303 010 6201 2453 [email protected] 24

Use Quizgecko on...
Browser
Browser