CHEAT SHEET 6

  


Cheatsheet (Processing User Input)

In this section, you learned that:

  • A Python program can get user input via the input function:

  • The input function halts the execution of the program and gets text input from the user:

  • The input function converts any input to a string, but you can convert it back to int or float:

  • You can format strings with (works both on Python 2 and 3):

Output: Hi Sim, you have 1.5 years of experience.

  • You can also format strings with:

Output: Hi Sim, you have 1.5 years of experience.


PYTHON PROGRAM SYNTAX SERIES

Comments

Popular Posts