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 ?
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)
