Skip to content

Commit 66e3daf

Browse files
authored
Add files via upload
1 parent 82636f6 commit 66e3daf

19 files changed

Lines changed: 316 additions & 0 deletions

String/as4.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Sat Oct 29 06:12:15 2022
4+
5+
@author: admin
6+
"""
7+
8+
s='akash is good person'
9+
print(s)
10+
print(s.replace(" ",'-'))

String/as5.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Sat Oct 29 06:05:43 2022
4+
5+
@author: admin
6+
"""
7+
# ass5
8+
str='akash'
9+
count=0
10+
for i in str:
11+
count=count+1
12+
print(count)

String/as6.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Sat Oct 29 06:17:01 2022
4+
5+
@author: admin
6+
"""
7+
#ass6
8+
l="maharastra"
9+
print(l)
10+
print(l[::2])

String/ass1.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Spyder Editor
4+
5+
This is a temporary script file.
6+
"""
7+
str="sandeep was in tension he wants his money back"
8+
print(str.replace('a','$'))

String/ass10.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Sat Oct 29 07:07:12 2022
4+
5+
@author: admin
6+
"""
7+
#ass 10
8+
a=input("Enter string ")
9+
print(a)
10+
b=input("Enter Character ")
11+
print(b)
12+
'''c=a[0]
13+
print(c)
14+
if b==c:
15+
print('String start with same character ')
16+
else:
17+
print('Not Same')'''
18+
if(a.startswith(b)):
19+
print('same')
20+
else:
21+
print('not same')

String/ass11.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Sat Oct 29 07:23:56 2022
4+
5+
@author: admin
6+
"""
7+
#assignment11;
8+
9+
print('Hello, {} you are {} yr old and your salary is {}'.format("sandy",21,5000))#default
10+
print('hello %s you are %d and your salary is %f'%("sandeep",21,500002554))
11+
print('Hello, {1} you are {0} yr old and your salary is {2}'.format(21,"sandy",5000))#positional
12+
print('Hello, {name} you are {age} yr old and your salary is {salary}'.format(age=21,name="Akash",salary=5000))#key value formatting
13+
name='Akash'
14+
age=26
15+
print(f"Myname is {name} my age is {age} and salary/month is {25**10}")

String/ass12.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Sat Oct 29 07:55:35 2022
4+
5+
@author: admin
6+
"""
7+
8+
str="AlwaysThinkPosiTive"
9+
print(str[5:6])
10+
print(str[10:11])
11+
print(str[5:8])
12+
print(str[-11:-14:-1])
13+
print(str[:])
14+
print(str[2:])
15+
print(str[:8])
16+
print(str[::-1])
17+
print(str[-3:-6:-1])
18+
print(str[:-2])
19+
print(str[-6:])
20+
print(str[::2])
21+
print(str[::-2])

String/ass13.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Sat Oct 29 08:18:20 2022
4+
5+
@author: admin
6+
"""
7+
#ass13
8+
s="The Quick brown fox jumps over the lazy dOG"
9+
print(s)
10+
print(s.lower())
11+
print(s.upper())
12+
print(s.title())
13+
print(s.swapcase())
14+
print(s.capitalize())

String/ass14.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Tue Nov 1 09:40:43 2022
4+
5+
@author: admin
6+
"""
7+
ls=[x**2 for x in range(11,21)]
8+
print(ls)

String/ass15.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Tue Nov 1 09:45:01 2022
4+
5+
@author: admin
6+
"""
7+
8+
l=[x for x in range(1,1001) if x%7==0]
9+
print(l)

0 commit comments

Comments
 (0)