Tuesday, 23 April 2024

VARIABLE METHODS


#how to find class use type()

a = ("manan")
print(type(a))

b= (5)
print(type(b))

#Assign Multiple Value In One Line:

c,d,e = "manan" , "hanan", "mani"
print(c)
print(d)
print(e)

#Assign One Value In Multiple Variables:

e = f = g = h = "manan"
print(e)
print(f)
print(g)
print(h)

# Index In Pythone: he is used for print specific value of list: let supose a list is ["a","b","c"] so
#index start is 0,1,2,3...... my case a=0 , b=1 , c=2

fruit = ("apple", "banana", "mango", "orange")
print (fruit[0])
print (fruit[1])
print (fruit[2])
print (fruit[3])

# Output VariableIn Pythone

i = "pythone"
j = "is"
k = "awesom"
print(i,j,k)
# # same as it is use + in place of , so
print(i + j + k)

# Mathmatical Variables : + , - , * , /

l = 10
m = 20
print(l + m)
print (l - m)
print (l * m)
print (l / m)

# Mathmetical Variable Does Not Work Between String or Intiger, Means String Or Numerical:

n = 5
o = "manan"
# print(n + o)
# so is used of , in Between:
print(n,o)

No comments:

Post a Comment

MAKE A CALANDER

  # 1.  convert calander year and month. your choice month or year , print while True :   import calendar   year = int ( input ( "P...