Write a python program that takes a number from the user. If the number is odd, print that many "*" and if the number is even, print that many "+" as output. Use for loop.
Example 1
Sample input: 5
Sample Output: *****
Example 2
Sample input: 10
Sample Output: ++++++++++
1
Expert's answer
2021-08-28T01:36:29-0400
n = int(input('Enter number her: '))
if n % 2 == 0:
print(n * '+')
else:
print(n * '*')
Enter number her: 5
*****
Enter number her: 10
++++++++++
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment