-2
Generate a record sequence
lote = int ( input ( 'Digite o nº do lote: ' ) )
tipo = int ( input ( 'Digite o tipo da placa: ' ) )
sequencial = int ( input ( 'Digite a o primeiro nº: ' ) )
tipo1 = "{:04n}".format ( tipo )
sequencial1 = "{:05n}".format ( sequencial )
num = int ( lote + tipo + sequencial )
def digital_root(num) :
x = sum ( int ( digit ) for digit in str ( num ) )
if x < 10 :
return x
else :
return digital_root ( x )
print('R.A.: ', lote, tipo1, sequencial1, digital_root ( num ))
Example
Entree
Enter the lot number: 28
Type the plate type: 100
Type the first number: 921
In print output a sequence like this:
R.A.: 28 0100 00921 5
R.A.: 28 0100 00922 6
R.A.: 28 0100 00923 7
R.A.: 28 0100 00924 8
R.A.: 28 0100 00925 9
R.A.: 28 0100 00926 1
R.A.: 28 0100 00927 2
R.A.: 28 0100 00928 3
R.A.: 28 0100 00929 4
R.A.: 28 0100 00930 5
Please edit your question by giving an example of your code input and what the output is. This information is unclear.
– Vitor Guimarães