23 - User Input ( input; getpass; isdigit ) | Python Tutorials

preview_player
Показать описание
Learn how to get input from the user, like a name, password, or numbers that you can then use in your code. Also, shows how to check if an int or float is valid before trying to convert them.

| Language
Python (.py)

| String Methods

| Code Example
Рекомендации по теме
Комментарии
Автор

Print("Sir, you save my day, thank you. Subscribed!")

SIRCAM
Автор

This was a great help for my class, but i'm still a bit confused. The assignment calls for me to define a function that checks to see if the age someone enters is a number, but if its over the age of 40, its supposed to say, you are over the hill. How would that work?

howardneal
Автор

And also what is the difference between '.isnumeric()', '.isdigit()', '.isdecimal()'. I've checked it but still don't understand it. Is '.isdigit()' the best one to use (like you did in the video)?

coopjmz
Автор

I tried running your example from git with getpass and it seems to not be working. It seems to be doing the same thing as Coop Jmz has stated and was wondering what we can do to fix this.

xiphos
Автор

I've imported 'getpass' and used it just the way you did, but it doesn't work for me. The problem is that it assumes 'Enter' to be for a new line and not submit. I don't know why it behaves like this. It could possibly be from the IDE (I use PyCharm). Could you help me with this matter? :)

coopjmz
Автор

Dude how to make the input characters appear in the form of "*"

basavarajm
Автор

it not work in interactive mode of python
like
import getpass
getpass.getpass()
warring:password may be echoed
password: gjfhjkk
#password not invisible

DheerajSharma-jxkj