Question: Can please someone help me with this python assignment In this challenge I want you to tell us your name and how old you are!
Can please someone help me with this python assignment
In this challenge I want you to tell us your name and how old you are!
Firstly, create a variable called start, and set it equal to "I am " -- Remember the space after the word "am"
Next, create a variable called age, and set it equal to your age in years. For example age = 20. -- This must be a number
Next create a variable called end , and set it equal to " years old" -- Remember the space before the word "years"
Next, create a variable called output and use the format() function to stick together start, age and end to make a string.
An example output string would be "I am 15 years old"
Finally, print the output string using the print() function
on the bottom this how i wrote my answer and i get error
# First, create a variable called start, and set it equal to "I am ". # Remember the space after the word "am" ! start = input("I am ")
# Next, create a variable called age and set it equal to your age in years. # This must be a number age = input(int(20))
# Next, create a variable called end, and set it equal to " years old". # Remember the space before the word "years" end = input("years old")
# Next, create a variable called output, and use the format() function to add # together the start, age and end variables.
string = "you are {} {},years {}" output = string.format(start, age, end) # An example output string would be "I am 15 years old" print(output)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
