Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Challenge questions/faisalmaqsood/task1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
def string_manipulation(word):
words = word.split()
first_conversion = " "
second_conversion = " "

for i in words:
name = i.capitalize()
first_conversion += name

for i in words:
name = i.lower()
second_conversion = second_conversion + " " + name

print("word", word)
print("1st Conversion", first_conversion.strip())
print("2nd Conversion", second_conversion.strip().capitalize())


string_manipulation('My name is faisal')
11 changes: 11 additions & 0 deletions Challenge questions/faisalmaqsood/task4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def read_csv(filename):
import csv
with open(filename, 'r') as csvFile:
reader = csv.reader(csvFile, delimiter=';')
for row in reader:
print(row)
break
csvFile.close()


read_csv('sample.csv')
11 changes: 11 additions & 0 deletions Challenge questions/faisalmaqsood/task5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import re

input = "45 >= 67 25==70 30 <= 78"
text = re.findall('(\d+\s?(<|=|>)=\s?\d+)', input)
output = ""
for i in text:
if eval(i[0]):
output += "1"
else:
output += "0"
print(output)