PYTHON CODING
1. name=input("Enter your name")
age=input("Enter your age")
print("your name is",name,"your age is",age)
result
Enter your name aliza
Enter your age 17
your name is aliza your age is 17
2. length=int(input("enter the length of your shape"))
width=int(input("enter the width of your shape"))
area=length*width
print("the area of your shape is:",area)
results
enter the length of your shape 2
enter the width of your shape 2
the area of your shape is: 4
3. number=int(input("enter a number:"))
if number&1==0:
print("even")
else:
print("odd")
result
enter a number:5
odd
4. marks=int(input("enter your mark"))
if marks>=80 and marks<=100:
print("you have passed","A")
elif marks>=70:
print("good try","B")
elif marks>=60:
print("work harder","C")
elif marks>=50:
print("really","D")
else:
print("you failed","F")
result
enter your mark 99
you have passed A
5. for i in range(1, 11):
print(i)
result
10
5. for i in range(5, 0, -1):
print(i)
results
5
4
3
2
1