Showing posts with label 2021. Show all posts
Showing posts with label 2021. Show all posts

R20 PYTHON PROGRAMMING LAB (1-25 Programs)


ADDON PROGRAMS

  1. In this assignment, you will have to take two numbers as input and print the difference.
  2. Input Format:
    The first line of the input contains two numbers separated by a space.
    Output Format:
    Print the difference in single line
    Example:
    Input:
    4 2
    Output:
    2
    
  3. write a program which prints the sum of the elements of LISTA with the corresponding elements of the reverse of LISTA. If LISTA has elements [1,2,3], then reverse of the LISTA will be [3,2,1] and the resultant list should be [4,4,4].
  4. Input:  2 5 3 1
    Output: 3 8 8 3
    
  5. Given a list of numbers, find maximum and minimum in this list.
  6. Input:
    1 2 3 4 5
    Output:
    5 1
    
  7. Given a list A of numbers, you have to print those numbers which are not multiples of 3.
  8. Input:
    1 2 3 4 5 6 5
    Output:
    1 2 4 5 5
    
  9. You are given a number A which contains only digits 0's and 1's. Your task is to make all digits same by just flipping one digit (i.e. 0 to 1 or 1 to 0 ) only. If it is possible to make all the digits same by just flipping one digit then print 'YES' else print 'NO'.
  10. Input:
    101
    Output:
    YES