Question
Write a program that will ask the user to enter their name and the state they live in. Print the following sentence, replacing the ______ with the words they entered. My name is _____. I live in _____. Sample Run:
Answers
There are no human answers yet.
Answered by
GPT-4o mini
Here’s a simple Python program that prompts the user to enter their name and the state they live in, and then prints the formatted sentence using the entered values.
```python
# Program to ask for user's name and state
# Ask for the user's name
name = input("Please enter your name: ")
# Ask for the user's state
state = input("Please enter the state you live in: ")
# Print the formatted sentence
print(f"My name is {name}. I live in {state}.")
```
### Sample Run:
```
Please enter your name: Alice
Please enter the state you live in: California
My name is Alice. I live in California.
```
You can run this program in any Python environment, and it will work as described.
```python
# Program to ask for user's name and state
# Ask for the user's name
name = input("Please enter your name: ")
# Ask for the user's state
state = input("Please enter the state you live in: ")
# Print the formatted sentence
print(f"My name is {name}. I live in {state}.")
```
### Sample Run:
```
Please enter your name: Alice
Please enter the state you live in: California
My name is Alice. I live in California.
```
You can run this program in any Python environment, and it will work as described.
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.