How do I make a series of numbers (3-in-3). Using for x in range?

Asked

Viewed 35 times

-4

How I make a series of numbers (3-in-3). Using for x in range ?

1 answer

2

EDITED

XF = input("Informe um valor inteiro e positivo:")

if XF.isdigit():
   var = int(XF)
   if var >= 0:
      for x in range(0, var, 3):
         # x disponível aqui
   else:
      print('Valor deve ser um número positivo')
else:
   print('Numero invalido')
  • Thanks, but when the user indicates the number of terms, like this: XF = int(input("Enter an integer and positive value:") for counter in range(0,XF,3):

Browser other questions tagged

You are not signed in. Login or sign up in order to post.