Posts

Showing posts from April, 2023

input any two number and find out Smallest number

Image
 #Write a program to input any two number and find out Smallest number among these numbers. x= int(input("Enter Value for X: ")) y= int(input("Enter Value for Y: ")) if (x<y):    print("X is Smallest Number ") else:    print("Y is Smallest Number") Output:    

Input any two numbers and find out largest number

Image
 #Write a program to input any two numbers and find out largest number among these numbers. x= int(input("Enter Value for X: ")) y= int(input("Enter Value for Y: ")) if (x>y):    print("X is Largest Number ") else:    print("Y is Largest Number") output:  

Use of Relational operators

Image
#Write a program to demonstrate the use of Relational operators x =int(input("Enter Value for X:")) y=int(input("Enter Value for Y:")) # Use of is less than print('x < y  is:',x<y)   # Use of is less than or equal to print('x <= y is:',x<=y)   # Use of is greater than print('x > y  is:',x>y)   # Use of is greater than or equal to print('x >= y is:',x>=y)   # Use of is equal to print('x == y is:',x==y)   # Use of is not equal print('x != y is:',x!=y)    output :

Use of break statement In python

Image
# Write a program to use of break statement  no = 0 for no in range(10):    no = no + 1    if no == 7:       break    # Here  break  statement stop next iteration    print("Number is:" + str(no)) Output:

Use of continue statement in python

Image
#Write a program to demonstrate the use of continue statement. for val in "Aryan Computers":     if val == "n":                  #Here n is skipped and continue to   next iteration         continue     print(val) Output: