I need the solution for 4a -> Python ( Pls provide with proper identation)
Posted: Fri May 20, 2022 11:14 am
I need the solution for 4a -> Python ( Pls provide with
proper identation)
Question 4 Part 1 The checksum letter of a 7-digits number is calculated as such: d= [(i iz i3 i4 is is in). (2765 4 3 2 )] mod 11 = ( 21, +7i2 + 6i3 + 5i4 + 4is + 3i6 +27) mod 11 Where is is the l* to last of the 7 digits of the 7-digits number and (2,7,6,5,4,3,2) are the weights. The checksum is a letter which corresponds to the number d as shown in the look-up table below + 10 9 8 7 OD 6 5 LO 4 3 2 1 0 d Checksum letter A B с D E E F G H 1 Z J Question 4a Define a function that meets the following specifications. Method name get_id checksum Parameter 1. str This str contains the numerical series mentioned in the description above. The length of the str object is 7. Return value 1. str An uppercase letter Detailed description From the given string of 7 numbers, computer the number das described in the section 'Part 1'. Return the letter which corresponds to the number das shown in the look-up table below d Checksum letter 10 А 9 8 7 6 5 32 1 0 B с D EFGHI J
proper identation)
Question 4 Part 1 The checksum letter of a 7-digits number is calculated as such: d= [(i iz i3 i4 is is in). (2765 4 3 2 )] mod 11 = ( 21, +7i2 + 6i3 + 5i4 + 4is + 3i6 +27) mod 11 Where is is the l* to last of the 7 digits of the 7-digits number and (2,7,6,5,4,3,2) are the weights. The checksum is a letter which corresponds to the number d as shown in the look-up table below + 10 9 8 7 OD 6 5 LO 4 3 2 1 0 d Checksum letter A B с D E E F G H 1 Z J Question 4a Define a function that meets the following specifications. Method name get_id checksum Parameter 1. str This str contains the numerical series mentioned in the description above. The length of the str object is 7. Return value 1. str An uppercase letter Detailed description From the given string of 7 numbers, computer the number das described in the section 'Part 1'. Return the letter which corresponds to the number das shown in the look-up table below d Checksum letter 10 А 9 8 7 6 5 32 1 0 B с D EFGHI J