Professional Documents
Culture Documents
Py 1
Py 1
#int
x=5
print(type(x))
#string
x = "hello"
print(type(x))
#float
x = 5.5
print(type(x))
#list
x = ["apple", "strawberry", "cherry"]
print(x)
print(type(x))
#tuple
x = ("apple", "banana", "strawberry")
print(x)
print(type(x))
#range
x = range(6)
print(x)
print(type(x))
#bool
x = True
print(x)
print(type(x))
#bits
x = b"Hello"
print(x)
print(type(x))
#bytearray
EXP NO :1
TITLE: Introduction to variable & data
NAME:KHUSHI KUMAWAT
ROLL NO:136
DATE:15/01/2024
x = bytearray(5)
print(x)
print(type(x))
#memoryview
x = memoryview(bytes(5))
print(x)
print(type(x))
#nonetype
x = None
print(x)
print(type(x))
#string
x = str("Hello Khushi")
print(x)
print(type(x))
#int
x = int(20)
print(x)
print(type(x))
#float
x = float(20.5)
print(x)
print(type(x))
#complex
x = complex(1j)
print(x)
print(type(x))
#list
x = list(("apple", "strawberry", "cherry"))
print(x)
print(type(x))
#tuple
x = tuple(("apple", "banana", "strawberry"))
print(x)
print(type(x))
#range
x = range(10)
print(x)
EXP NO :1
TITLE: Introduction to variable & data
NAME:KHUSHI KUMAWAT
ROLL NO:136
DATE:15/01/2024
print(type(x))
#dict
x = dict(name="ANSH", age=45)
print(x)
print(type(x))
#random() function
import random
print(random.randrange(1, 40))
OUTPUT:
y
Roll no : 136
Name : Khushi Kumawat
Collgee Name: Thadomal Shahni Enginerring Clg
Branch: SE/IT
DOB: 12/08/2004
Address: bhadar nagar, m2, rooom no 7,malad(west)
5 is greater than 2
done!
3
<class 'int'>
me
EXP NO :1
TITLE: Introduction to variable & data
NAME:KHUSHI KUMAWAT
ROLL NO:136
DATE:15/01/2024
<class 'str'>
new value
<class 'str'>
3
1
khushi
Roll no : 136
Name : Khushi Kumawat
Collgee Name: Thadomal Shahni Enginerring Clg
array: mango apple banana
hello
<class 'int'>
<class 'str'>
<class 'float'>
['apple', 'strawberry', 'cherry']
<class 'list'>
('apple', 'banana', 'strawberry')
<class 'tuple'>
range(0, 6)
<class 'range'>
frozenset({'banana', 'cherry', 'apple'})
<class 'frozenset'>
True
<class 'bool'>
b'Hello'
<class 'bytes'>
bytearray(b'\x00\x00\x00\x00\x00')
<class 'bytearray'>
<memory at 0x0000011BDDE9FC40>
<class 'memoryview'>
None
<class 'NoneType'>
Hello Khushi
<class 'str'>
20
<class 'int'>
20.5
<class 'float'>
1j
<class 'complex'>
['apple', 'strawberry', 'cherry']
<class 'list'>
('apple', 'banana', 'strawberry')
<class 'tuple'>
range(0, 10)
<class 'range'>
{'name': 'ANSH', 'age': 45}
<class 'dict'>
EXP NO :1
TITLE: Introduction to variable & data
NAME:KHUSHI KUMAWAT
ROLL NO:136
DATE:15/01/2024
10
20.8
1j
<class 'int'>
<class 'float'>
<class 'complex'>
10.0
20
(10+0j)
<class 'float'>
<class 'int'>
<class 'complex'>
26