Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
количество 1 и 0 в последовательности чисел до n
#python 3.5.2 print ("Hello, world!") n = int(input('Введите число:')) print() s0,s1= 0,0 for i in range (n+1): while i > 0: if i % 2 == 0: s0+=1 else: s1+=1 i = i // 2 print ('i=', i,'s1=',s1, 's0=', s0) print ("") print ('s1=',s1, 's0=', s0)
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
self "keyword"
1
Omirp
recursion for adding 2 numbers
FlipFlop operator in Python
fibo_1
Calendar 12 months
Python: Functions I : Functions with messages.
two-digits-puzzle
Converion of dictionary to list of tuples (Stackoverflow problem)
Please log in to post a comment.