+ 2
Python Challenge 24 - HELP NEEDED WRITING THIS CODE
I need to write the following into python code but I am currently struggling with a few things; here is the written description of what I need to convert to Python Python challenge 24: Write a function that takes two numbers. The first number indicates the number of spaces that should be displayed The second shows the number of Xs that should be displayed. These should both be displayed on the same line. Now write another function that makes multiple calls to your first function and draws a picture with Xs.
5 Answers
+ 4
Here is a really simple code in Python, it could be enhanced to print some more complex shapes..
https://code.sololearn.com/c7oSEHZTPmsV/
+ 2
the description is not clear. what picture are you trying to achieve?
spaces and X on one line could give you the size of every line (andd subsequentlly the size of the whole picture) in charachters. I presume that the function that makes multiple calls to the size of every line shold take care of arranging such char on the in order to build a picture line by line.
In your description is missing the logic of this charachters arrangement.
+ 1
def function(space, star):
print(" "*space+"X"*star)
def doManyTimes(function, number):
for i in range(number):
function(space, star)
space=int(input("how many spaces?"))
star=int(input("how many X?"))
number=int(input("how many row?"))
doManyTimes(function, number)
it works for me. in codeplayground you should give the input in multiple line at the first prompt, it doesnt ask you one by one.
0
@seamiki
I was given that task the way you see it and thats why am confused
0
can someone help me this is my summer homework please help me solve this challenge am stuck