File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 44print ('''Choose one of the bases for conversion:
55[ 1 ] convert to BINARY
66[ 2 ] convert to OCTAL
7- [ 3 ] convert toHEXADECIMAL ''' )
7+ [ 3 ] convert to HEXADECIMAL ''' )
88option = int (input ('your choose:' ))
99if option == 1 :
1010 print (f'{ number } converted to binary it becomes { bin (number )[2 :]} .' )
Original file line number Diff line number Diff line change 1+ # Redo CHALLENGE 51, reading the first term and the reason of an AP, showing the first 10 terms of the progression
2+ # using the while structure.
3+ print ("Arithmetic progression generator" )
4+ print ("-=-" * 20 )
5+ first_term = int (input ("Enter the first term:" ))
6+ reason = int (input ("Enter the reason of the arithmetic progression:" ))
7+ term = first_term
8+ counter = 1
9+ while counter <= 10 :
10+ print (f"{ term } " , end = ' ' )
11+ term += reason
12+ counter += 1
13+ print ("End" )
You can’t perform that action at this time.
0 commit comments