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 ##### ##### ##### ##### #####
number = int(input("please enter a number: ")) for i in range(1, number+1): print(number * "#")
try: side = int(input("tell me the side of square: ")) except: print("please tell a positive number") for i in range(side): print(side*"# ")
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)
x = int(input("enter number:")) for a in range(1 , x+1): print(x * "# ", end="\n")
Submitting answers is currently unavailable.
Write a function that receives a string and return the encrypted value according to the algorithm below. Then write a function that receives the encryption phrase and returns the initial string. In this encryption: Everything must be with ...
Write a program that receives the square side length from the input and calculates its area of square area = a side of its own = a side of a power 2.
Write a program that translates the following words from Farsi to English and vice versa. The program must be implemented infinitely and it is possible to add new words easily words: Hello = hello goodbye = bye Kata ...
Write a function that returns the number of a character in a string. To this question you should not use ready -to -use functions ("hooshang", "O") #2
Create a table and include the following people including name, city and age.
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.