Posts

Denominations(1000, 500, 100, 50, 20, 5, 1)

 Denominations(1000, 500, 100, 50, 20, 5, 1)         nominals = (1000, 500, 100, 50, 20, 5, 1)      amount = int(input())      output = {}      for n in nominals: output[n] = amount // n amount %= n      for k, v in output.items(): print(k, v, sep=':')

write a program to determine whether the traingle is Equilateral or Isosceles or Scalene

  write a program to determine whether the traingle is Equilateral or Isosceles or Scalene      a = int(input())      b = int(input())      c = int(input())      if a ==  b == c:          print("Equilateral")      elif a==b or b==c or c==a:          print("Isosceles")      else:           print("Scalene")     

write a prgram to print the name of the month

  write a prgram to print the name of the month n = int(input()) if (n==1):     print("January") if(n==2):     print("February") if (n==3):     print("March") if (n==4):     print("April") if (n==5):     print("May") if (n==6):     print("June") if (n==7):     print("July") if (n==8):     print("August") if (n==9):     print("September") if (n==10):     print("October") if (n==11):     print("November") if (n==12):     print("December") if (n<1 or n>12):     print("Invalid Month Number")     

hand game

finding the absolute difference(no negetive sign)

  finding the absolute difference(no negetive sign)      n1=int(input())      n2=int(input())      print(abs(n1-n2))

write a program to convert n to years weeks and days

 given number of days as input.write a program to convert n to years weeks and days.      import sys      try:           days = int(sys.argv[1])      except:           days = int(input())      y = days / 365      w = (days % 365) / 7      d = (days % 365) % 7      print("%d years %d weeks %d days" % (y, w, d))

write a program to print digits in its one place.

  first place:     ->write a program to print digits in its one place.                n=input()           print(n[-1])