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)
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")
num=int(input("write a number:")) i="#" for x in range(1,num+1): print(i*num)
Submitting answers is currently unavailable.
Write a program that receives a number from the input and checks whether the number is segmented to 5. Tips: The numeric is on 5 segments that remain the remaining 5 zero
Write a program that receives a number of input and from that number to zero countdown and prints in the output
Write a program that receives the user's name from the input and prints the following welcome message what is your name: amirhossein welcome amirhossein
Write a program that prints paired numbers between 1 and 100
Write a program that the user can add and delete the student name. After each deletion or adding the student, the list of existing students should be displayed as below Choose: 1.Add 2.Rmove1name: hooshang1 ....
Write a program that obtained a person's / BMI body / BMI formula and, according to the information below, shows the status of the person BMI = w / h * h formula = weight divided by second power BMI ...
We want to open the cow door, we don't know the password, but we have the following information: the second -digit safing password and the fifth digit equivalent to the first number of the first digit of a larger unit ...
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.