Python latest_01

 '''

a = 10
b = "Rishabh"
c = 45.9
d = True

# Printing the variables
print(a)
print(b)
print(c)
print(d)

# Printing the type of variables
print(type(a))
print(type(b))
print(type(c))
print(type(d))


# Operators -->

a = 55
b = 33

# 1. Arithmetic Operators -->
print("The result of a+b is:-\t",a+b)
print("The result of a-b is:-\t",a-b)
print("The result of a*b is:-\t",a*b)
print("The result of a/b is:-\t",a/b)

# 2. Assignment Operators -->
c = 23
c += 17
c -= 17
c *= 17
c /= 17
print(c)

# 3. Comparison Operators -->
d = 34
e = 56
print(d==e)
print(d!=e)
print(d>e)
print(d<e)
print(d>=e)
print(d<=e)

# 4 Logical Operators -->
f = True
g = False
print(f and g)
print(f or g)
print(not g)


# Typecasting -->

a = "345"
print(a)
print(type(a))
a = int(a)
print(a+64)
print(type(a))
a = float(a)
print(a)
print(type(a))


a = input("Enter your name:-\t")
print("Hello "+a+" good morning.")
b = input("Enter your number:-\t")
b = int(b)
print("Your lacky number is:-\t",b)
'''

Comments

Popular posts from this blog

Physics Dpp 11th

Chemistry Notes 11th