Lab Assignment 1 - SaiTejasweeReddy/PythonLabAssignments GitHub Wiki

  1. Check whether a number input by the user is even or odd
    • Sample input:
    • Enter Number: 13
    • Sample output:
    • Number entered by user is odd

  1. Take length and breadth of a rectangle from user and print perimeter of the same.
    • Sample input:
    • Enter length: 10
    • Enter breadth: 6
    • Sample output:
    • Perimeter of the rectangle with length 10 and breath 6 is 60

  1. This is a number guess exercise. First pick a random digit via program i.e 0,1,2,3,4,5,6,7,8,9
    Ask the user to guess the digit randomly picked by your program. Then print whether the number guess by the user is perfect or below the random number or above the random number. Also your program should explain the rules of this number guess game to the user.
    Suppose the digit generated by program is 8
    • Sample input:
    • Guess the digit: 7
    • Sample output:
    • Your answer is low than required
    • Sample input:
    • Guess the digit: 8
    • Sample output:
    • Your answer is PERFECT!! Congratulations!!
    • Sample input:
    • Guess the digit: 9
    • Sample output:
    • Your answer is high than required