Exercise 3.x

Run Settings
LanguagePython
Language Version
Run Command
# Bai 3.1 print('Bai 3.1\n') input = 24 s = str(bin(input)) print('Chuoi binary ',s) a = s.rindex('1') print('Thu tu cua so 1 la',a) print('Phan tu so 1 cuoi cung ben phai la ',s[-a-1:]) print('#'*70+'\n') # Bai 3.2 print('Bai 3.2\n') s = 13 print('So nguyen ',s) if s>0: print('This is positive number') elif s<0: print('This is negative number') else: print('This is zero') print('#'*70+'\n') # Bai 3.3 print('Bai 3.3\n') input3 = 'ccecec.ecewc.dfg' print('File thong tin ',input3) a3 = input3.rindex('.') print('Phan mo rong :',input3[a3:]) print('#'*70+'\n') # Bai 3.4 print('Bai 3.4\n') input4 = list(range(6,13)) print('Chuoi so lieu',input4) if len(input4)%2 ==1: a4 = int(len(input4)/2)+1 else: a4 = int(len(input4)/2) i=0 while i<=a4: print(input4[i],'\t',input4[a4+i]) i = i+1 print('#'*70+'\n') # Bai 3.5
Editor Settings
Theme
Key bindings
Full width
Lines