Python Forum
Help creating an asterisk and T diamond
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help creating an asterisk and T diamond
#1
Question 
Hi, I need to create a T diamond mixed with asterisks, so I was hoping someone could help me with the best way to go about doing this.

Enter the length (an even number between 0 and 20): -1
Enter the length (an even number between 0 and 20): 3
Enter the length (an even number between 0 and 20): 22
Enter the length (an even number between 0 and 20): 10
Enter the char used left to the diamond: *
Enter the char used to fill the diamond: T
\TTTTTTTT/
*\TTTTTT/
**\TTTT/
***\TT/
****\/
****/\
***/TT\
**/TTTT\
*/TTTTTT\
/TTTTTTTT\
Reply
#2
https://python-forum.io/misc.php?action=help&hid=52 Wrote:This forum is focused on education. It exists to help people learn Python. We don’t exist to solve others’ problems, although that tends to be a happy byproduct of education.
What have you tried so far? what part do you need help with?
Do you have some code to share in code tags along with any error traceback that may have occurred presented in error code tags?
Reply
#3
Is that a diamond? It looks like a diabolo to me. I would draw a diamond like this:
Output:
****/\**** ***/TT\*** **/TTTT\** */TTTTTT\* /TTTTTTTT\ \TTTTTTTT/ *\TTTTTT/* **\TTTT/** ***\TT/*** ****\/****
One can still argue it this resembles a diamond, but at least it resembles a diamond in playing cards.

You have to split your assignment in several parts. From what you show us the first part is about inputting values. The input values should be checked and while the check fails, the user should be asked again for the correct input value.
Show us how you solve this. Then we can continue with the computation part.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020