The Basics - Python 3: Taking Integer and Float Inputs

preview_player
Показать описание
In this video we look at how to use casting to take inputs for floats and doubles in Python 3
Рекомендации по теме
Комментарии
Автор

Hey, I know this video is from years ago but thanks for helping me I got all right answers on my exam :)

anjarawr
Автор

Thanks a lot man. I was stuck on it for around 30 mins or so

MrMiyagi
Автор

THANKS SO MUCH FOR MAKING THIS VIDEO
IT HELPED ME A TON!!!!

leotota
Автор

YOU HELPED ME OUT MUCH THNX MAN I'VE BEEN SEARCHING THE NET FOR SOMETHING LIKE FOR HOURS

bantersquad.
Автор

If I am not wrong, it can be checked whether the user inputs a number or not.

# Check if numeric input
num = input('Please input a number: ')
if num.isnumeric():
num = int(num)
elif num.count('.') == 1 and num.replace('.', '').isnumeric():
num = float(num)
else:
print('Input numbers only!')
exit()
num = num * 5
print('The number you entered times 5 is {}'.format(num))
print('Program executed successfully.')

sktneer
Автор

Thank you for your time in creating this video it was very helpful to me in my studies.

najahdavenport
Автор

Very helpful vid. Thanks! Can you please explain to me the proper usage of the operators /, //, and %. I particularly need assistance with the usage of %. I understand / is common division, // rounds down, and % utilizes the remainder, unless divided by 2. However, I don't understand when the use of % is called for.

Kystehl
Автор

What if you have to take multiple int inputs at a time using whitespaces

shyamsunderraosirivolu
Автор

Bro first time I will subsribe an tech channel that is yours

ajithhbm
Автор

is there a way we can loop through this?
try:
shapeSides = int(input("sides: "))
except:
print('please enter a number')
shapeSides = int(input("sides: "))
makes me think on a while loop, like while shapeSide != integer, but doesnt work like that, any idea?

DanielMejia
Автор

What if the condition is like this


target_column = ['Confirmed']
predictors =
ds[predictors] =
ds.describe().transpose()


TypeError: unsupported operand type(s) for /: 'str' and 'str'


I just want to divide those values Thanks.

reinaldofanuel
Автор

sir what is the software you have used here?

Savant_AK
Автор

Thank u bro I will suffer thank u very much bro

ajithhbm
Автор

it's still saying "could not convert string to float" at this line, in=float(input("Enter a number"))

AbdirahiimYa
Автор

there are some things I need help, can some one help with with this?
x=int(raw_input(“Please enter a number”))
if x>5:
print “A”
else:
print “B”
I need help with the int, raw_input Please help me

iuvgecu
Автор

I know this video is really old, but WHY does it assume it's a string? It doesn't make sense!

eatbreakfasts