Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. 8:
  2. x = int (input("Enter Number : "))
  3. if x>=1 and x<=10:
  4. print("Number Is In First 10 Counting Numbers")
  5. if x>=11 and x<=20:
  6. print("Number Is In Second 10 Counting Numbers")
  7. if x>=21 and x<=30:
  8. print("Number Is In Third 10 Counting Numbers")
  9. else:
  10. print("It's not belongs any category")
  11.  
  12. 9:
  13. x=34
  14. while x<=98:
  15. print(x)
  16. x=x+1
  17. 10:
  18. x=109
  19. while x>=45:
  20. print(x)
  21. x=x-1
  22. 11:
  23. x=0
  24. y=1
  25. while x<10:
  26. print(y)
  27. y=y+2
  28. x=x+1
  29. 12:
  30. modules = ["Computer Architecture","Data Structures And Algorithms","Wep Application Development"]
  31. print(modules)
  32.  
  33. 13:
  34. odd = [1,3,5,7,9,11,13,15,17,19]
  35. print(odd[2:9])
  36. 14:
  37. ans = []
  38. for x in range(10):
  39. y=(x+1)*(x+1)
  40. ans.insert(x,y)
  41.  
  42. for x in ans:
  43. print(x)
  44.  
  45. 15 :
  46. def power(base,exp):
  47. ans=base
  48. for x in range(1,exp):
  49. ans = ans*base
  50. return ans
  51.  
  52. x = int(input("Enter Base Value : "))
  53. y = int(input("Enter Exponent Value : "))
  54. print(power(x,y))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement