CodeSolved

Solved Programming Questions & Exercises

Checking the segmentability of two numbers (without conditional commands)

Practice Easy 913/ Download 893 Views

Write a program that receives two A and B numbers from the user and checks whether the number A on the number b is partly segmented. The output should be true or false.


Tip: In this exercise you should not use conditional commands like if. (The use of comparative operators is permitted)

14 Answers

a = int(input("adad1: "))
b = int(input("adad2: "))
c = a % b
print(c == 0)

F.sarli Download Python New
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
a = int(input("Adad Aval :"))
b = int(input("Adad Dovom :"))
print(a%b == 0)
Programmer Download Python
def divisible_nums(a, b):
    return a % b == 0
number1 = int(input(": "))
number2 = int(input(": "))
divisible = divisible_nums(number1, number2)
print(divisible)
Amirgr Download Python
a =int(input("a:"))
b =int(input("b:"))
print([ a % b == 0])
J1625 Download Python
a = int(input("enter your number a:"))
b = int(input("enter your number b:"))
c =  a % b == 0
print(bool(c))
Sumy.amiri Download Python
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

Related content

Detection using AI
×
×
Close