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 the user's age from the input and checks that if the user was younger than 1, it would be a throw/raise error, otherwise print a welcome message
Write a program that receives a number from the input and increases the number 2 and prints in the output. This trend continues until the number 0 is not arrived
Write a program that receives 2 users and calculates the Fibonacci series (between those two) and prints in the output
The program receives the amount of distance traveled to kilometers and the amount of fuel consumed in liter and prints according to the following instructions, whether the car is low or high. If the fuel consumption of this car is less than 7 liters ...
Write a program that receives a student's lessons and the number of each unit (receiving the score and the number of units until the number is 0).
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.