0

I'm using input() to receive a user's input but do not want it to display at all because I want to assign it to a variable right away.

For example,

enter image description here

My goal output is just 'Height in inches is: 78.406'. I do not want to display the entered '199'.

I do not want to use getpass as I only want to have one line of output.

Thank you!

Jacob3454
  • 175
  • 1
  • 9
  • There is only one line of output here, as well. You want the `x` to be a user defined value, so user should have provision to enter it somewhere. – Austin Sep 16 '20 at 05:09
  • How is the user supposed to know if they've made a mistake, such as accidentally typing in `100` because it's dark and they can't see the keyboard properly? – paxdiablo Sep 16 '20 at 05:12
  • https://stackoverflow.com/questions/4616813/can-i-get-console-input-without-echo-in-python – Frank Yellin Sep 16 '20 at 05:16
  • You do not need the parentheses around `input()`. – DYZ Sep 16 '20 at 05:16
  • I agree with @paxdiablo. Unless the user is typing a password, they expect to see what they're typing echoed. – Frank Yellin Sep 16 '20 at 05:17

1 Answers1

-1

you can use cls command. (windows only)

import os
clear = lambda:os.system('cls')

x =  int(input())
clear()
print("height in inches : ", x*0.394)