Advertisement
sadim

Untitled

Jul 27th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.21 KB | None | 0 0
  1.  
  2.  
  3.         سؤال 1
  4.         x = 0
  5.         while x < 20:
  6.             a, b =input("Enter Number with kama : ").split(',')
  7.             print(float(a) - float(b))
  8.             x += 1
  9.     ---------------------------------------
  10.         سؤال 2 :
  11.         chess = 0
  12.         total = 0
  13.         while chess < 64:
  14.             chess += 1
  15.             total = total + chess
  16.            
  17.         print(total)
  18.     ---------------------------------------
  19.        سؤال 3 :
  20.         import random
  21.         x = 0
  22.         while x < 10:
  23.             number = random.randint(100,170)
  24.             f_number = number % 2
  25.             if f_number != 0:
  26.                 print(number)
  27.                 x += 1
  28.      
  29.     ---------------------------------------
  30.      
  31.         سؤال 4 :
  32.         tall = float(input("Enter The tall : "))
  33.         width = float(input("Enter The Width : "))
  34.         area = tall * width
  35.         kind = 'square' if tall == width else 'Rectangular'
  36.         print("the area of" , kind , "is", area)
  37.      
  38.     ---------------------------------------
  39.      
  40.             سؤال 5 :
  41.         number = float(input("Enter A Number : "))
  42.         msg    = 'good' if number > 0 else 'Error'
  43.         print (msg)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement