The sum of the figures of the number
Write a program that receives a number from the user and prints the sum of its figures in the output
Write a program that receives a number from the user and prints the sum of its figures in the output
let msg = 'error' alert(msg)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
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
const num = prompt("Enter number"); let sum = 0; for (let number of num) { sum += parseInt(number); } console.log(sum);
total=0 a=int(input('num:')) for i in str(a): total += int(i) print(total)
def sum_of_numbers(i): while 1: a=int(input('num:')) if a==0: break i+=a print(i) d=int(input('num:')) print(sum_of_numbers(d))
num=int(input("num: ")) x=0 while num>0: digit=num%10 x+=digit num=num//10 print(f"total: {x}")
# sum of digits Num = int(input("Give me a number: ")) sum = 0 while Num != 0 : Num1 = int(Num % 10) Num = int(Num / 10 ) sum = sum + Num1 print(f"The sum of digits is: {sum}")
a=int(input("num:")) b=int(input("num:")) print(a+b)
num = input("enter your number:") a = 0 for i in num: a = a + int(i) else: print(a)
It was great
Submitting answers is currently unavailable.
Scissors Paper Play: 1- The user chooses one between paper or scissors. 2- Select the system by random. 3- With the choice of user and system, the result is displayed and the user's rating is calculated 4- ... ...
Write a function that receives a username and if it was a character except the lowercase English letters, FALSE and otherwise TRUE
Parking Management Program Write: When arriving, arrival time and car license plate number stored when exit, exit time save for the desired car at any moment (in the parking lot, exit) and other information ...
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.