Python code 2
Python code 2
lnk
hello.py> ...
1 a=int (input ("Enter a number:"))
2 if (a%2) ==0:
3 print (a, "is even")
4 else:
5 print(a, "is odd")
hello.py.
a=int (input ("Enter side 1:"))
2 b=int (input ("Enter side 2:"))
c=int(input ("Enter side 3:"))
4 if a=b==c:
print("It is an equilateral triangle")
6 elif (a==b) or (b==c) or (a==c):
7 print ("It is an isosceles triangle")
elif a!=b!=c:
print ("It is a scalene triangle")
hello.py >...
1 a=input ("Do you like python?: ")
2 if a=="Yes" or a=="yes" or a=="YES":
3 print ("That's great !")
1 elif a="No" or a==" no" or a=="NO":
print ("That is disappointing")
6 else:
print ("Enter yes/no")
hello.py >.
1 a=int (input ("Enter the side 1 of a triangle: "))
2 b=int (input ("Enter the side 2 of a triangle : ") )
3 c=int (input ("Enter the side 3 of a triangle: ") )
4 if (((a*a) +(b*b) )== (c*c)) or (( (b*b)+(ctc) ) ==(a*a) ) or (((a*a) +(c*c) )==(b*b) ):
print("It is a right angled triangle")
6 else:
print ("It is not a right angled triangle")
8