Jump to content
Fórum Script Brasil
  • 0

Alguém pode me ajudar a transformar essa linguagem para portugol?


Suzi Andrade
 Share

Question

vetNum1 = []

vetNum2 = []

#Leitura de 5 Valores VetNum1

linha1 = input("Digite os valores separado por espaço")

vetNum1 = linha1.split()

#Leitura de 5 Valores VetNum2

linha2 = input("Digite os valores separado por espaço")

vetNum2 = linha2.split()

#Multiplicação

vetNum3 = []

for elemA, elemB in zip(vetNum1, vetNum2): #Percorrendo o vetor VetNum1 e #VetNum2

   multi = int(elemA) * int(elemB) #conversão em inteiro

   vetNum3.append(multi)

print(vetNum3)

#Soma

vetNum4 = []

for elemC, elemD in zip(vetNum1, vetNum2): #Percorrendo o vetor VetNum1 e #VetNum2

   soma = int(elemC) + int(elemD) #conversão em inteiro

   vetNum4.append(soma)

print(vetNum4)

#Armazenando Contrario

vetNum5 = []

for elemA in vetNum1[::-1]: #Percorrendo o vetor VetNum1 e quando utilizamos [::-1] ele percorre de trás apra frente

   vetNum5.append(elemA) #adicionando no vetor

print(vetNum5) #Printando

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      149.9k
    • Total Posts
      646.8k
×
×
  • Create New...