Hello all...this is stumping me...it keeps returning a repetition of num ten times rather than multplying by 10...Which way can I fix this?

def main():
    num = input('Please enter a number: ')
    print(times_ten(num))

def times_ten(num):
    return 10 * num
main()

Thanks!!!

Recommended Answers

All 2 Replies

Hello everyone...solved it after some playing around with string returns..

def main():
    print(times_ten())


def times_ten():
    #Get user's first name
    num = float(input('Enter your number: '))
    #Return
    return num * 10
main()

This is the solution (assuming Python3) ...

def main():
    num = float(input('Please enter a number: '))
    print(times_ten(num))

def times_ten(num):
    return 10 * num

main()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.