Skip to content

Commit dd47f73

Browse files
committed
basic
1 parent e6ed180 commit dd47f73

26 files changed

+135
-0
lines changed

String/concatnation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
a = "Hello"
2+
b = "World"
3+
c = a + b
4+
print(c)
5+
c = a + " " + b
6+
print(c)

String/format.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
age = 36
2+
txt = f"My name is John, I am {age}"
3+
print(txt)
4+
5+
price = 59
6+
txt = f"The price is {price:.2f} dollars"
7+
print(txt)
8+
9+
txt = f"The price is {20 * 59} dollars"
10+
print(txt)

String/info.txt

Whitespace-only changes.

String/methad.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
a="the world is very very smart you can think only ."
2+
print(a.capitalize())#It capitalizes the first character of the String.
3+
print(a.count("the","you"))

String/modify.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
a = "Hello, World!"
2+
print(a.upper())
3+
print(a.lower())
4+
print(a.split(' '))
5+
print(a.replace("H", "J"))
6+
print(a*2)

for loop/else.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
for i in range(1,10):
2+
print (i)
3+
else:
4+
print("Loop has ended")

for loop/intr.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fruits = ["apple", "banana", "cherry"]
2+
for x in fruits:
3+
print(x)

for loop/range.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
for x in range(6):
2+
print(x)

for loop/str.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
for x in "banana":
2+
print(x)

if_elif/and.py

Whitespace-only changes.

0 commit comments

Comments
 (0)