Hi, I'm working in the following project:
Write a function in python that displays at the left margin of the screen a solid square of asterisks whose side is specified in integer parameter side. For example, if side is 4, the function displays
****
****
****
****
I did this program before in C++ but now I need to do it in PYTHON PROGRAMMING and I'm not sure how to do it. Can anybody please help me to do this function in Python?THANKS A LOT!!!!
P.D: This is how I previously did it in C++, but unfortunately, Python is completely different :(
//This says put an asterix on a line size times for(int i=0; i<size; i++) { cout<< '*' << endl; }} //This says put size number of asterixes on one linefor(int i=0; i<size; i++) { cout<<'*'; } cout << endl;} //If you complete the blank line in the following snippet correctly it will put size asterixes on a line and repeat it for size lines /*put code in the blank line immediately below this and before the first { to control how many lines are written*/ { //this line controls how many asterixes per line for(in i = 0; i < size; ++i) { cout<<'*'; } //this starts a new line cout << endl; }}//This says put an asterix on a line size times
for(int i=0; i<size; i++)
{
cout<< '*' << endl;
}
}
//This says put size number of asterixes on one line
for(int i=0; i<size; i++)
{
cout<<'*';
}
cout << endl;
}
//If you complete the blank line in the following snippet correctly it will put size asterixes on a line and repeat it for size lines
/*put code in the blank line immediately below this and before the first { to control how many lines are written*/
{
//this line controls how many asterixes per line
for(in i = 0; i < size; ++i)
{
cout<<'*';
}
//this starts a new line
cout << endl;
}
}