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.
Scissors Paper Play: 1- The user chooses one between paper or scissors. 2- Select the system by random. 3- With the choice of user and system, the result is displayed and the user's rating is calculated 4- ... ...
Write a function that receives a string (String) as input and reversed it for example Reverse ('amir') # rimareoverse ('Hello') # Olleh
Write a function that receives some and checks whether the amount received is the email. If the email was True, otherwise the False return the email should contain @ before @ should be a phrase as a work name ...
Write a program that receives a store product listing including name and product price and will continue until the amount of empty value for the product name is entered; Then the product name is displayed as a list ...
Write a program that receives the square area from the user and prints the size of each side in the output
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.