+ 5
Python program to separate a number containing 4 into two numbers without 4.Description provided below.answer fast.thanks!
For example, 44 is the number then it can be separated into 22 and 22 likewise the entered number should be separated into two numbers such that their sum is equal to input.
3 Antworten
+ 6
According to my understanding, you want output numbers to not contain 4, so here it is just for the record.
import random
n = int(input())
while True:
n1 = n - random.randint(1,n)
n2 = n - n1
if '4' not in str(n1).join(str(n2)):
break
print(n1)
print(n2)
https://code.sololearn.com/c3z7982anzFE/?ref=app
+ 4
Yes..
if NoIsEven :
a = n/2
b= n/2
else :
n = n + 1
a = n/2
b = n/2 -1
Any doubt please :)
+ 2
Can you show your attempts?