0% found this document useful (0 votes)
2 views2 pages

Day 1 Notes

Uploaded by

asifmahaldar00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Day 1 Notes

Uploaded by

asifmahaldar00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

print function prints the content written in its bracket

eg:
print('asif')

data type

string = str = anything written in single quote or double quote


eg:
string1 = 'asif'
string2 = "asif"
string3 = '120'
string4 = '25.5'

integer = int = any whole number in python is regarded as an int data type
eg:
age = 25
price = 150

floating point = float = any decimal number is regarded as a floating point number
eg:
price = 150.7
distance = 120.4

type casting: method for changing the data type a varaible or anything we pass
variable or value to the bracket of new data type
a = 30 ===> integer data type
if we want to conver this data to string
a = str(30)
or
a = str(30)
print(a)
output ==> '30'

print(type(a))
cls<'str'>

suppose we want to convert a floating number to integer


a = 25.3
print(type(a))
output ==> cls<'float'>

a = int(a)
print(a)
output ==> 25
print(type(a))
output ==> cls<'int'>

input function: is use when we want to take any input from user
eg:
my_name = input("enter your name :")
print(f"my name is {input}") #====> i have use f string format to enclose the
variable in a print statement
output:
enter your name : asif
my name is asif

You might also like