Ask Question

We are providing a string as an input to your program. Your job is to add the string, hello! to the string we provide you and then output it. Make sure you include the space after the comma! a. # Input from the command lineb. import sysc. name = sys. argv[1]d. # Write code below

+2
Answers (1)
  1. 27 December, 12:08
    0
    Answer explained below

    Explanation:

    import sys

    name = sys. argv[1]

    aString = ''

    newString = name + ', hello!'

    print (newString)

    NOTE:

    A string is not an integer, so you need to add the apostrophe which denotes it is a set of characters, rather than just adding it to the name variable. This would result in an inappropriate type error.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “We are providing a string as an input to your program. Your job is to add the string, hello! to the string we provide you and then output ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers