159k views
2 votes
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

User SuRu
by
7.7k points

1 Answer

1 vote

Answer:

Answer explained below

Step-by-step 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.

User Aliquis
by
6.2k points