Basic Python
# print("i am ved.","i am 22 years old.")
# print(2+3)
# data types in python
# age=22
# fullName="ved"
# price=89.5
#print("my age is=",age)
# print(type(age))
# print(type(fullName))
# print(type(price))
# we can not write true , only True in python
# isFollow=True
# print(isFollow)
# None used for when there is no value assign
# a=None
# print(type(a))
# str1='ved'
# str2="ved"
# str3='''ved'''
# print(str1)
# print(str2)
# print(str3)
# python is case sensitive language
# there are 35 keywords in python
# a=2
# b=5
# sum=a+b
# print(sum)
# comment in python
# 1st is use #
# 2nd is use triple quots """
"""
hey
my
name
ved
"""
# / division operator gives result in decimal
# print(4/2) # 2.0
# ** is used for power a**b is a^b
# logical operator - and , or , not
# print(not True)
# a=10
# b=20
# c=30
# print(a>b or a>c)
# print(a<b and a>c)
# type casting
# a="2"
# b=int(a)
# print(type(a))
# print(type(b))
# a=3.14
# b=str(a)
# print(type(b))
# print(type(a))
# input in python , result of input() method is always string
# myname=input("enter your name=")
# print(myname)
# age=int(input("enter your age="))
# print(type(age),age)
Comments
Post a Comment