so I am still learning Python so this should be rather easy to answer for some of you experts...
1) How can you make it so only numbers are accepted as an input?
def check_only_digit():
digits = input("Please input a number ")
if digits in "0123456789":
print("Working")
else:
print("Not working")
check_only_digit()
This will print "Working" if the inputted is a number in 0123456789 but only is this order. What I am asking is there any way to make it in any order?
2) How can I make the users digit round UP to the nearest 10?
def round_up():
users_number = input("Please input a number you want rounded ")
answer = round(int(users_number), -1)
print (answer)
round_up()
3) Is there anyway to add a number onto the end of another number? For example for 1+1, instead of equaling 2, can it equal 11?
I would like to thank you all for your responses in advance.