Jump to content

Coach

Donator
  • Content Count

    3
  • Donations

    £10.00 
  • Joined

  • Last visited

  • Country

    United Kingdom

Community Reputation

1 Neutral

About Coach

  • Rank
    Fresh Spawn

Personal Information

  • TS Name
    Coach
  • Points Rank

  • Points
    2,008,681,369

Recent Profile Visitors

758 profile views
  1. GTIN = input("Enter the 7 digit number... ") length = len(GTIN) if length == 7: GTIN = list(GTIN) GTIN_ = ((int(GTIN[0])*3)+int(GTIN[1])+(int(GTIN[2])*3)+int(GTIN[3])+(int(GTIN[4])*3)+int(GTIN[5])+(int(GTIN[6])*3)) GTIN8 = (GTIN_ + 9) // 10 * 10 - GTIN_ strGTIN = ''.join(GTIN) GTIN_F = str(strGTIN) + str(GTIN8) print("The full GTIN-8 code is... "+str(GTIN_F)) else: print ("Invalid") I don't know if this is what you wanted but it works and seems more condensed in a way.
×
×
  • Create New...