From 64ca40e3a2f77adb872900d386b6bfeaf3583960 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 4 May 2017 15:17:35 +0200 Subject: Modified some files --- python/conversioneBinariaDec.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'python/conversioneBinariaDec.py') diff --git a/python/conversioneBinariaDec.py b/python/conversioneBinariaDec.py index 2ff1bb6..113eb85 100644 --- a/python/conversioneBinariaDec.py +++ b/python/conversioneBinariaDec.py @@ -1,18 +1,18 @@ -from math import pow +import math b = 32 v = [0 for i in range(b)] -str = input('Stringa: ') +stringa = input('Stringa: ') -if len(str) < b: - valVuoto = len(str) +if len(stringa) < b: + valVuoto = len(stringa) i = b - valVuoto j = 0 while i < b: - v[i] = int(str[j]) + v[i] = int(stringa[j]) i += 1 j += 1 @@ -20,7 +20,7 @@ i = b - 1 j = num = 0 while i > -1: - num += v[i] * pow(2, j) + num += v[i] * math.pow(2, j) i -= 1 j += 1 -- cgit v1.2.3-18-g5258