Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- i = 0
- pvet = []
- #for i in range(10):
- while i < 10:
- x = random.randint(1, 15)
- pvet.append(x)
- i += 1 #incrementa
- print('Primeiro Vetor: ', pvet)
- svet = []
- i = 0
- #for i in range(10):
- while i < 10:
- x = random.randint(1, 15)
- svet.append(x)
- i += 1 #incrementa
- print('Segundo Vetor: ', svet)
- tvet = []
- i = 0
- a = 0
- b = 0
- #for i in range(20):
- while i < 20:
- if a < 10:
- tvet.append(pvet[i])
- a += 1
- if b < 10:
- tvet.append(svet[i])
- b += 1
- i += 1 #incrementa
- print('Intercalacao de Vetores: ', tvet)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement