HOLIDAY SALE! Save 50% on Membership with code HOLIDAY50. Save 15% on Mentorship with code HOLIDAY15.

11) User Input and String Formatting Lesson

Introduction: User Input in Python

3 min to complete · By Martin Breuss

You've already learned a lot about coding, and you're getting close to having seen all of the concepts you used right at the beginning of this course when you got to play the guess-the-number game. Do you remember this overwhelming graphic:

Different programming concepts at the hand of a game

Concepts You've Already Learned

  • Variables and variable assignment
  • Numbers, None type, and strings
  • Type conversion
  • Comparison operators
  • Indentation
  • Conditional statements
  • Terminal output with print()

The while loop used in this code might seem somewhat familiar. It's similar to the for loop you learned about in the previous section. If it still looks confusing, don't worry; you'll learn all about it in this section.

Concepts You're About to Learn

With all the topics mentioned above checked off the list, that means that there are only a few concepts missing before you've got the whole graphic deciphered:

  • Collecting user input
  • The while loop
  • Loop keywords
  • Getting and using a package, which is code that someone else wrote

In the following two sections, you'll cover all the remaining concepts! After that, when you look at the graphic of the guess-the-number code, you'll stop thinking It's a colorful image and start thinking Ah! I get it! :)

You'll start by learning how to prompt a user to enter input to your program through the command line.