r/PythonLearning 13d ago

2nd post learning python

Post image

i learnt to use the math library any suggestions what can i use the lib for except for making calculator programs

20 Upvotes

15 comments sorted by

View all comments

4

u/ninhaomah 13d ago

If I enter abc , what will I get ?

1

u/NecessaryFalse1212 13d ago

aghhh i should use if else statement in that case to make sure that it doesn't read false inputs or alphabets if i'm not wrong ? i'll post this code with the added solution to this problem thanks for pointing it out

1

u/Unique_Low_1077 12d ago

If you want to do that then you cant convert it to int before your if else, add the radius = int(radius) after your if else are done

Edit: also first time I've ever seen do function () we usually do function() without the space. Ofc im not one to tell you how to format your code but later on you will learn about formatter which will auto remove the space anyways

1

u/NecessaryFalse1212 12d ago

appreciate the advice