Answer to Question #303302 in Python for Cristelle Maddela

Question #303302

Create a Python script which will accept a positive integer (n) and any character then it will display the input character n times.


Sample Output:

Positive Integer (n) : 7

Input any Character : A

A A A A A A A


I need the code to have an output stated above.



1
Expert's answer
2022-02-28T08:30:58-0500
n = int(input('Enter positive integer here: '))
char = input('Enter any character here: ')
for i in range(n):
    print(char, end = ' ')

Enter positive integer here: 7
Enter any character here: A
A A A A A A A

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS