The construction of the box with squares
Write a program that receives a number and prints the figure below according to the number
Example
number: 3 ### ### ###
Example
number: 5 ##### ##### ##### ##### #####
Write a program that receives a number and prints the figure below according to the number
Example
number: 3 ### ### ###
Example
number: 5 ##### ##### ##### ##### #####
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
shekl = input("\nshekle: ") # Get the pattern shape
num = int(input("number: ")) # Get the number
for x in range(num): # Pattern printing
print(num * shekl)
print(f"\n{(x+1)*num}\n") # Printing the number of shapes used
def Square(): Num = int(input("Enter Number: ")) for i in range(Num): print(Num *"#") Square()
الگوی مثلثی python def print_triangle(number): for i in range(number): print('#' * (number - i)) # Get a number from the user number = int(input("number: ")) print_triangle(number) الگوی مستطیلی python def print_rectangle(number): for i in range(number): print('#' * number) # Get a number from the user number = int(input("number: ")) print_rectangle(number)
#include <iostream>
#include <conio.h>
using namespace std;
main()
{
int n;
cout << "enter your n: ";
cin >> n;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n ; j++)
{
cout << "#";
}
cout << endl;
}
getch();
}
def print_shape(number): # We check that the input number is positive if number <= 0: print("لطفاً یک عدد مثبت وارد کنید.") return # Shape printing for i in range(number): # In each line, if I am equal to Number-1, we print a specific line if i == number - 1: print('#' * (number - 1) + ' ') else: print('#' * number) # Get input from the user try: number = int(input("عدد را وارد کنید: ")) print_shape(number) except ValueError: print("لطفاً یک عدد صحیح وارد کنید.")
#include <iostream> using namespace std; int main() { cout<<"x?"; int x; cin>>x; for(int i=0;i<x;i++){ for(int j=0;j<x;j++){ cout<<"#"; } cout<<endl; } return 0; }
num = int(input("enter your number:")) a = 1 for i in range(1,num+1): if i < num+1: print(a * num * "#") print(end="") else: print("\n")
Submitting answers is currently unavailable.
Write a program that receives 2 numeric value from the input and stores in variables A and B. Then move the values of these two variables (the value of variable A is to be stored within B and the value of variable B is saved within a)
Write a program that receives 2 users and calculates the Fibonacci series (between those two) and prints in the output
Write a program that receives a text from the user as an input and all the words used in the text, along with the number of repeating them to the user, such as: Input: This is an Example. This is a text ... ...
Write a class that receives rectangular length, width and height and calculates its area and volume using different methods
Write a program that receives a number and only by moving its figures, the smallest numbers can be found (with the same number of digits)
You must be logged in to access this section.
Login/Sign up If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.