Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6a54830

Browse files
Merge pull request #536 from Ashu-1309/pattern
Pattern
2 parents ff07f56 + c9ac6f2 commit 6a54830

File tree

6 files changed

+107
-0
lines changed

6 files changed

+107
-0
lines changed
73.3 KB
Loading[フレーム]
71.8 KB
Loading[フレーム]
90.9 KB
Loading[フレーム]

‎BasicPythonScripts/Pattern/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Pattern
2+
## Aim:- Print Different Pattern
3+
4+
## Purpose :-
5+
Pattern
6+
7+
## WorkFlow :_
8+
-First of all user need choice which operation they want to perform.
9+
-Then , they have to give input.
10+
-On the basis of their choice selection the desired pattern will be printed.
11+
12+
13+
### main():-
14+
It is the only function that contain all the computation work .
15+
It takes the input from user and and perfprm the operation.
16+
17+
### stepup_pattern()
18+
This Function can be used to print the pattern as likes :-
19+
*
20+
* *
21+
* * *
22+
* * * *
23+
24+
### stepdown_pattern()
25+
This Function can be used to print the pattern likes :-
26+
* * * *
27+
* * *
28+
* *
29+
*
30+
31+
### pyramidal_pattern()
32+
This Function can be used to print the pattern as likes :-
33+
*
34+
* *
35+
* * *
36+
* * * *
37+
38+
39+
40+
41+
## Setup instructions
42+
-User need any python ide to run the program
43+
44+
## Display images/gifs/videos of output/result of your script so that users can visualize it
45+
46+
https://github.com/prathimacode-hub/Awesome_Python_Scripts/pull/536/commits/07d8ac492efc89da42a2eddb993699ebd7b65b2a#diff-7f1b0012e1c61ea590b52b9f4577e9a66f03ff2f90d86b53f694af2fe0ee6758
47+
48+
https://github.com/prathimacode-hub/Awesome_Python_Scripts/pull/536/commits/07d8ac492efc89da42a2eddb993699ebd7b65b2a#diff-8f39869ecbb451d557f895ff78213ac89b64e5a6d4a41498639dbe22ff9a1c3b
49+
50+
https://github.com/prathimacode-hub/Awesome_Python_Scripts/pull/536/commits/07d8ac492efc89da42a2eddb993699ebd7b65b2a#diff-96f025f0aa4dd9059158278cc0f98fabcfc0427c8d549914872badb01afbfc32
51+
52+
53+
## Author(s)
54+
Ashutosh Kumar Saw <br>
55+
56+
57+

‎BasicPythonScripts/Pattern/pattern.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
def stepup_pattern(value):
2+
for i in range(value):# Loop use for creating number of rows
3+
for j in range(i): # Loop for printing pattern
4+
print(" * " , end =" ") # Printing the patttern
5+
print("\n")
6+
7+
def stepdown_pattern(value):
8+
i=value
9+
while(i>0):# Loop use for creating number of rows
10+
for j in range(i): # Loop for printing pattern
11+
print(" * " , end =" ") # Printing the patttern
12+
print("\n")
13+
i=i-1
14+
15+
16+
def pyramidal_pattern(value):
17+
space =value- 1 # defining variable for space
18+
for i in range(0,value): # Loop use for creating number of rows
19+
for j in range(0, space): # Loop for creating space
20+
print(end=" ") #Providing Space
21+
space = space - 1 # Decrement of space value
22+
for j in range(0, i + 1): # Loop for printing pattern
23+
print(" * ", end="") # Printing the patttern
24+
print("\r")
25+
26+
27+
def main():
28+
print(" Enter 1 for Stepup Pattern ")
29+
print(" Enter 2 for Stepdown Pattern ")
30+
print(" Enter 3 for Pyramidal Pattern ")
31+
choice=int(input (" ")) #input taking for performing the operation
32+
value=int(input(" Enter the number of steps "))
33+
34+
#Condition checking fordiffernent operation.
35+
if choice == 1:
36+
stepup_pattern(value)
37+
elif choice == 2:
38+
stepdown_pattern(value)
39+
elif choice == 3:
40+
pyramidal_pattern(value)
41+
42+
condition=int(input(" Enter 1 to continue or else to exit "))
43+
if condition == 1: #condition checking for re-executing the program.
44+
main() # Recalling main function
45+
else:
46+
exit() #exiting the program
47+
48+
49+
main() # Calling the main function
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
User Need to have any pythone IDE for running the program.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /