168k views
2 votes
Write a single statement to print: user_word,user_number. Note that there is no space between the comma and user_number. Sample output with inputs: Amy' 5 Amy,5 1 test 1 user_word = str(input) 2 user_number = int(input) 3 user_word = 'Amy' 4 user_number = '5' 5 print(user_word+","+str(user_number)) passed A tests passed ✓ Testing with inputs: Amy' 5 Your output Amy,5 x Testing with inputs: 'Joe' 8 Output differs. See highlights below. Your output Amy,5 Expected output Joe, 8

User Nebril
by
7.8k points

1 Answer

4 votes

Final answer:

Use the 'print()' function to output 'user_word' followed by a comma without a space, and then 'user_number' converted to a string.

Step-by-step explanation:

To print user_word and user_number separated by a comma without a space, you can use the following statement:



print(user_word + ',' + str(user_number))



This statement uses the print() function to output the value of user_word, followed by a comma ',', and then the converted value of user_number as a string using the str() function.

User Arka
by
7.9k points