CodeSolved

Solved Programming Questions & Exercises

Investigating the figures of the number

Practice Easy 1386/ Download 1430 Views

Write a program that receives a number of input and prints its smallest and largest digit

27 Answers

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.
m=[]
n=input("enter:")
for i in n :
    m.append(int(i))
    m.sort()
x=len(m)    
print (f"min={m[0]}    max={m[x-1]}")
User 489 Download Python
while True:
    num = input("enter your number:")
    if num == "0":
        print("end")
        break
    dgh = [int(dgh) for dgh in num]
    mindgh = min(dgh)
    maxdgh = max(dgh)
    print(f"kochak tarin addad: {mindgh}")
    print(f"bozorgtarin addad: {maxdgh}")
Sumy.amiri Download Python
num1 = int(input("num : "))
b=str(num1)
c = b.find(max(b))
d = b.find(min(b))
print(f"max is {b[c]}")
print(f"min is {b[d]}")
User 5288 Download Python
N1=int(input("Enter Number: "))
N2=int(input("Enter Number: "))

# ّ Find the Largest Number
largest = max(N1,N2)
print("This is the largest number:",largest)

# Find the smallest number
smallest = min(N1,N2)
print("This is the smallest number:",smallest)
Amirali Download Python
while True:
    try:
        in_put=int(input(f"Enter a number: "))
        break
    except ValueError:
        print("Please enter a number")
    except:
        print("An unknown error occurred")

digit=[int(i) for i in str(in_put)]

print(f"The greatest number is {max(digit)} and the least number is {min(digit)}")
def s(number):
    digits = [int(digit) for digit in str(number)]
    max_digit = max(digits)
    min_digit = min(digits)
    return max_digit, min_digit
num=int(input("num: "))
max_digit, min_digit=s(num)
print(f"max: {max_digit}")
print(f"min: {min_digit}")
x = 0
a = input('enter the number')
for i in a :
    i = int(i)
    if x < i :
        x = i
z = x 
print(x,'بزرگترین رقم')
for j in a :
    j = int(j)
    if z > j :
        z = j
print(z,'کوچکترین رقم')
User 779 Download Python
<< Previous page 1 2 3 Next page >>

Submit answer

Submitting answers is currently unavailable.

×
×
Close