0% found this document useful (0 votes)
11 views

Programming Fundametals Assigment

The document discusses basic data types in Python including integers, floating-point numbers, complex numbers, strings, Booleans, lists, tuples and ranges. It provides examples of each data type by assigning values and printing them.

Uploaded by

faraz mahmood
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Programming Fundametals Assigment

The document discusses basic data types in Python including integers, floating-point numbers, complex numbers, strings, Booleans, lists, tuples and ranges. It provides examples of each data type by assigning values and printing them.

Uploaded by

faraz mahmood
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

NAME: Faraz Mahmood

ROLL NO: BSSE SP. 2021


DEPARTMENT: BSSE
SUBMITTED TO : Khiza Hanif

ASSIGNMENT# 1 FUNDAMENTAL PROGRAMMING

Data types in Python:


Basic data types in python are;

1. Integers
2. Floating-Point Numbers
3. Complex Numbers
4. Strings ( Escape sequence in strings, Raw strings, Triple quoted strings )
5. Boolean type

Every value in Python has a datatype. Since everything is an object in Python programming, data types
are actually classes and variables are instance (object) of these classes.

Some of the important types are listed below.

Text Type: str

Numeric Types: int, float, complex

Sequence Types: list, tuple, range

Boolean Type: bool

EXAMPLES:
 Str : A = “Hello World”

X = ‘’’Ahmed.

He is 19 years old.

He is a good boy. ’’’

Print(A) > output ….. Hello World

Print(X) > output…… Ahmed


He is 19 years old.

He is a good boy.

 Int : X = 20

Print(x) >> output…… 20

 Float : x =10.5

Print(X) >> otput …… 10.5

 List : x = [“apple” , “banana” , “mango”]

Print(list) >> output ……“apple” , “banana” , “mango”

 Tuple : x = [“apple” , “banana” , “mango”]

Print(Tuple) >> output ……“apple” , “banana” , “mango”

 Bool : x = true

Print(x) >> output … true

You might also like