Skip to content

Commit bef572d

Browse files
authored
Merge pull request #409 from rushithakare7350/main
Rushihacker1
2 parents c151a70 + 8df0a7c commit bef572d

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed

pattern1.cpp

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//pattern
2+
/*
3+
*
4+
* *
5+
* * *
6+
* * * *
7+
* * * * *
8+
*/
9+
#include<iostream>
10+
using namespace std;
11+
int main(){
12+
int n;
13+
cin>>n;
14+
for(int i=0;i<n;i++){
15+
for(int j=i;j>0;j--){
16+
cout<<j;
17+
}
18+
cout<<endl;
19+
}
20+
}

pattern2.cpp

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* pattern
2+
*****
3+
*****
4+
*****
5+
*****
6+
*****
7+
*/
8+
#include<iostream>
9+
using namespace std;
10+
int main(){
11+
int n;
12+
cin>>n;
13+
for(int i=n;i>0;i--){
14+
for(int j=0;j<n;j++){
15+
cout<<"*";
16+
}
17+
cout<<endl;
18+
}
19+
}

rotate.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
n,d = map(int,input().split())
2+
arr=list(map(int,input().split()))
3+
4+
for i in range(d):
5+
first=arr[0]
6+
for j in range(n-1):
7+
arr[j]=arr[j+1]
8+
arr[n-1]=first
9+
print(*arr,sep=" ")

set.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
s = {1,2,2,3,4}
2+
print(s)
3+
#s1 = {{1,2},{3,4}}
4+
s1 = {frozenset({1,2}),frozenset({3,4})}
5+
print(s1)
6+
#print(type(s))
7+
b = {3,3,4,4,5}
8+
print(b)
9+
10+
#intersection
11+
print(s.intersection(b))
12+
print(s&b)
13+
14+
#union
15+
print(s.union(b))
16+
print(s|b)
17+

0 commit comments

Comments
 (0)