input , variable, output

Cards (21)

  • What are variables used for in programming?
    To store data in programs
  • How should variable names be formatted?
    Lowercase at the start
  • What does the equals operator (=) do in programming?
    Assigns a value to a variable
  • What does the input function do in Python?
    Captures user input
  • What is printed when the input function is called with a prompt?
    "Please enter your name:"
  • What does the variable 'inputtedName' store?
    The name entered by the user
  • What will the program output if the user enters "Bob"?
    "Your name is: Bob"
  • What does the print function do with the inputted name?
    Displays the name on the screen
  • How does the program capture user input?
    Using the input function
  • What are the key components of the program's input and output process?
    • Input function captures user name
    • Variable stores the inputted name
    • Print function displays the name
  • What is the purpose of the console shell in the program?
    To interact with the user
  • What does the term 'argument' refer to in the context of the print function?
    The data passed to the function
  • How does the program ensure that the user's name is printed correctly?
    By using the inputted name variable
  • What are the steps involved in the program's execution flow?
    1. Prompt user for name
    2. Capture input using input function
    3. Store input in a variable
    4. Print the stored name
  • What is the output of the program if the user enters "Bob"?
    "Your name is: Bob"
  • What is the significance of the variable 'inputtedName' in the program?
    It holds the user's name
  • How does the program handle the user's input?
    It captures and stores it in a variable
  • What type of data does the input function return?
    A string
  • Why is it important to use lowercase for variable names?
    To follow naming conventions
  • If you wanted to change the prompt message, where would you modify the code?
    In the input function's argument
  • What happens if the user enters an empty name?
    The program will still print an empty name