Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #1.)
- from random import randint
- y=0
- while (y<10):
- broj=randint(1,1001)
- if broj>100 and broj<500:
- y+=1
- print (broj)
- #2.)
- while True:
- x=int(input("unesite x:"))
- y=int(input("unesite y:"))
- if x>0 and y>0:
- if x>y:
- for i in range (y+1,x):
- print (i)
- if y>x:
- for i in range (x+1,y):
- print (i)
- else:
- print("greška")
- break
- #3.)
- broj=int(input("unesite broj:"))
- x=0
- brojac=0
- while (x<32):
- x+=1
- if broj&1==1:
- brojac+=1
- broj=broj>>1
- print (brojac)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement