 How can change output as input in the same program in python?? | SoloLearn: Learn to code for FREE!

+1

# How can change output as input in the same program in python??

Pls help me .I am stuck here (they are 3 variabl (a,b,c) =8,8,8 then a+b)/2 and similar for b+c )/2 c+a)/2 get output even when we get odd stop.... My attempt: A,B,C=6,4,8 If A%2==B%2==C%2==0: While A%2==0: A=(A+B)/2 print(A,end=" ") While B%2==0: B=(C+B)/2 print(B,end=" ") While C%2==0: C=(A+C)/2 print(c,end=" ")

+4

I can't read it. Please post your code in the playground so I can see the output.

+3

Pavan Kalyan Link your code for getting any help from the community Plz rewrite your question clearly

+3

Pavan Kalyan Above sample output is wrong, it should be like 👇👇👇👇 8,8,4 8,6,6 7,6,7 Now, run the code below 👇, it's satisfactory a,b,c=4,12,4 print(a,b,c) while True: if (a+b)%2==0 and (b+c)%2==0 and (a+c)%2==0: a,b,c=(a+b)//2,(b+c)//2,(a+c)//2 print(a,b,c) else:break

+3

+2

Pavan Kalyan I've not understood your sample input output Plz elaborate it little bit more

+1

They are 3 variable a+b)%2!=0 stop similar b+c) Example input 8,8,4 Sample output 8,6,4 7,5,6 Stop you got odd number

+1

Please post the code and show us that you are making an attempt. I can't read that!!

+1

Jay Matthews A,B,C=6,4,8 If A%2==B%2==C%2==0: While A%2==0: A=(A+B)/2 print(A,end=" ") While B%2==0: B=(C+B)/2 print(B,end=" ") While C%2==0: C=(A+C)/2 print(c,end=" ")

+1

𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 Thank you Great help from your side Further any assistance... Pls help meee

0

0

Jay Matthews 𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 A,B,C are 3 three number if you ((A+B)/2 is even ,(C+B)/2 is even , (A+C)/2 is even ,) if you got any odd number out of 3 variable pls stop Here A=3,B=4,C=2 A=(A+B)/2 B=(B+C)/2 C=(C+A)/2 A,B,C ARE EVEN DO SIMILAR PROCESSES UNTIL YOU GOT ODD STOPPP

0

Jay Matthews Pavan Kalyan I hope it will satisfy your question a,b,c=4,8,6 while True: if (a+b)%2==0 and (b+c)%2==0 and (a+c)%2==0: a=(a+b)//2 b=(b+c)//2 c=(a+c)//2 else:break print(a,b,c)

0

𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 Sample input 4,12,4 Output 8,8,4 8,6,6 7,3,7 Stop you got odd out three variables

0

𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 pls help buddy