Skip to content

Commit 8679f9a

Browse files
All updated done by Venkatesh
1 parent f670b2a commit 8679f9a

10 files changed

+32
-8
lines changed

Day-02/examples/01-string-concat.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
str1 = "Hello"
22
str2 = "World"
3-
result = str1 + " " + str2
4-
print(result)
3+
#result = str1 + " " + str2
4+
result = str1 +" "+ str2
5+
print(result);
6+
7+
8+
9+
10+

Day-02/examples/01-string-lowercase.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
lowercase = text.lower()
44
print("Uppercase:", uppercase)
55
print("Lowercase:", lowercase)
6+
7+
print("UpperCase:",text.upper())
8+
9+
print("LowerCae:",text.lower())

Day-02/examples/01-string-split.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
text = "Python is awesome"
22
words = text.split()
3-
print("Words:", words)
3+
#print("Words:", words)
4+
5+
print("Hi Venkatesh :", words)

Day-02/examples/01-string-strip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
text = " Some spaces around "
1+
text = "Some spaces around"
22
stripped_text = text.strip()
33
print("Stripped text:", stripped_text)

Day-02/examples/01-string-substring.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
substring = "is"
33
if substring in text:
44
print(substring, "found in the text")
5+
6+
7+

Day-02/examples/02-float.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@
1616
print("Division:", result4)
1717

1818
# Rounding
19-
result5 = round(3.14159265359, 2) # Rounds to 2 decimal places
19+
#result5 = round(3.14159265359, 2 ) # Rounds to 2 decimal places
20+
21+
22+
result5 = round(3.0001, 2 ) # Rounds to 2 decimal places
2023
print("Rounded:", result5)

Day-02/examples/02-int.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
num2 = 5
44

55
# Integer Division
6+
#result1 = num1 // num2
67
result1 = num1 // num2
78
print("Integer Division:", result1)
89

@@ -11,5 +12,6 @@
1112
print("Modulus (Remainder):", result2)
1213

1314
# Absolute Value
14-
result3 = abs(-7)
15+
#result3 = abs(-7) #
16+
result3 = abs(-8)
1517
print("Absolute Value:", result3)

Day-02/examples/03-regex-findall.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import re
22

33
text = "The quick brown fox"
4-
pattern = r"brown"
4+
pattern = r"daya"
55

66
search = re.search(pattern, text)
77
if search:
88
print("Pattern found:", search.group())
99
else:
1010
print("Pattern not found")
11+

Day-02/examples/03-regex-replace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
text = "The quick brown fox jumps over the lazy brown dog"
44
pattern = r"brown"
55

6-
replacement = "red"
6+
replacement = "Venkatesh"
77

88
new_text = re.sub(pattern, replacement, text)
99
print("Modified text:", new_text)

Day-02/examples/test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name = venkatesh
2+
3+
print(name.upper())

0 commit comments

Comments
 (0)