Hi.
I want to get the results of this program in an excel file.
Nine numbers.I have the results in terminal in python without any problem but how can I get
these nine numbers in an excel file separately ?
I want to get the results of this program in an excel file.
Nine numbers.I have the results in terminal in python without any problem but how can I get
these nine numbers in an excel file separately ?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
from fileinput import filename from turtle import shape import numpy as np import pandas as pd import xlsxwriter from xlsxwriter.utility import xl_rowcol_to_cell from openpyxl import workbook from openpyxl.utils import get_column_letter from datetime import datetime import xlwt from xlwt import Workbook for i in range ( 101000 , 101009 ) : j = str (i) first_digit = int (j[ 0 ]) second_digit = int (j[ 1 ]) third_digit = int (j[ 2 ]) fourth_digit = int (j[ 3 ]) fifth_digit = int (j[ 4 ]) sixth_digit = int (j[ 5 ]) if second_digit * 2 > 9 : secondigit = second_digit * 2 - 9 else : secondigit = second_digit * 2 if fourth_digit * 2 > 9 : fourthdigit = fourth_digit * 2 - 9 else : fourthdigit = fourth_digit * 2 if sixth_digit * 2 > 9 : sixthdigit = sixth_digit * 2 - 9 else : sixthdigit = sixth_digit * 2 numbersum = (first_digit) + (secondigit) + (third_digit) + (fourthdigit) + (fifth_digit) + (sixthdigit) # print(numbersum) check_digit = (( 10 - (numbersum % 10 )) % 10 ) def add_digit_right(i,check_digit) : return str (i) + str (check_digit) df = add_digit_right(i,check_digit) print (df) |