# WAP TO CHECK WHETHER THE GIVEN NUMBER IS EVEN OR ODD. """ EVEN NUMBER ==> A NUMBER WHICH CAN EVENLY DIVIDED WITH '2' ODD NUMBER ==> A NUMBER WHICH CANNOT EVENLY DIVIDED WITH '2' """ number = int(input("Enter a number:")) # remainder = number % 2 # # if remainder == 0: if number % 2 == 0: print(number,"is an even number.") else: print(number,"is an odd number.") ===================================================== # WRITE A PROGRAM IN PYTHON TO TAKE TWO INTEGERS AS AN INPUT AND IF THEY ARE SAME # FIND SUM # IF THEY ARE DIFFERENT, FIND DOUBLE THE SUM. """ a and b ==> two numbers a == b ==> a+b a != b ==> (a+b)*2 """ number1 = int(input("Enter first number:")) number2 = int(input("Enter second number:")) if number1 == number2: result = number1 + number2 else: result = 2*(number1 + number2) print("The Result = ",result) ============================================= # WAP IN PYTHON TO TAKE AN INTEGER AS AN INPUT AND DO THE FOLLOWING: # IF THE GIVEN INPUT IS DIVISIBLE BY '3' THEN DISPLAY "NUMBER IS DIVISIBLE BY '3'" # IF THE GIVEN INPUT IS DIVISIBLE BY '5' THEN DISPLAY "NUMBER IS DIVISIBLE BY '5'" # IF IT IS DIVISIBLE BY 3 AND 5 BOTH THEN DISPLAY "NUMBER IS DIVISIBLE BY '3' AND '5' BOTH" number = int(input("Enter a number:")) # if number % 3 == 0: # print(number,"is divisible with '3'") # elif number % 5 == 0: # print(number,"is divisible with '5'") # elif number % 3 == 0 and number % 5 == 0: # print(number,"is divisible with '3' and '5' both") # else: # print(number,"is divisible neighther with '3' nor '5'") if number % 3 == 0 and number % 5 == 0: print(number, "is divisible with '3' and '5' both") elif number % 3 == 0: print(number, "is divisible with '3' only") elif number % 5 == 0: print(number, "is divisible with '5' only") else: print(number, "is divisible neighther with '3' nor '5'") ========================================================== # WAP TO FIND THE BIGGEST NUMBER AMONG THREE INTEGERS. """ a, b and c ==> Three integers a > b and a > c ==> "a is bigger" b > c ==> "b is bigger" otherwise ==> "c is bigger" """ n1 = int(input("Enter first number:")) n2 = int(input("Enter second number:")) n3 = int(input("Enter third number:")) if n1 == n2 and n2 == n3: print("All three integers are equal.") exit() # Transfer statement or jumping statement if n1 > n2 and n1 > n3: print(n1,"is bigger") elif n2 > n3: print(n2,"is bigger") else: print(n3,"is bigger") ================================================================ Assignment: ========== 1) WAP TO TAKE USER NAME AND PASSWORD AS INPUT. IF USERNAME IS "admin" AND PASSWORD IS "admin123" THEN DISPLAY "LOGIN SUCCESSFUL" OTHERWISE DISPLAY "LOGIN FAILED".