Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create readme.md #381

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
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
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/100DaysOfCode.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Bishal/Day1Question1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
def names(name):
sta = """
Hello {}!
Welcome to our world of new innovations.
"""
print(sta.format(name))


def altnames(name):
st = f"""
Hello {name}!
Welcome to our new era!
"""
print(st)


n = input("What's your name?\n")
names(n)
altnames(n)
20 changes: 20 additions & 0 deletions Bishal/Day1Question10.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class Student:
def __init__(self, age, height, weight, gender):
self.age = age
self.height = height
self.weight = weight
self.gender = gender

@staticmethod
def intro(first, sur):
print(f"\n\nName: {first} {sur}")

def __str__(self) -> str:
return f"Gender: {self.gender}\nAge: {self.age} years\nHeight: {self.height} feet\nWeight: {self.weight} kgs"


b = input("Enter first name: ")
m = input("Enter surname: ")
student = Student(float(input("Enter you Age: ")), float(input("Enter you Height: ")), float(input("Enter you Weight: ")), input("Enter you Gender: "))
Student.intro(b, m)
print(student)
5 changes: 5 additions & 0 deletions Bishal/Day1Question11.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import datetime
print(datetime.datetime.now().day)
print(datetime.datetime.now().month)
print(datetime.datetime.now().year)
print(datetime.datetime.now().time())
13 changes: 13 additions & 0 deletions Bishal/Day1Question12.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from datetime import datetime
from datetime import date

print("Default Format:")
print(datetime.today())
print("Changed Format:")
new = datetime.now()
print(new.strftime("Format 1:\n%d.%m.%Y\n%H:%M:%S\n"))
print(new.strftime("Format 2:\n%d %B/%y\n%H:%M:%S\n"))
print(new.strftime("Format 3:\n%d %b/%Y\n%H:%M:%S"))
print(new.strftime("Format 3:\n%m/%d/%Y\n%I:%M %p"))
print("Printing only dates:")
print(date.today().strftime("%d %B/%y"))
13 changes: 13 additions & 0 deletions Bishal/Day1Question2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def sortnames(name1, name2, name3):
x = [name1, name2,Dname3]
x.sort()
print("Your Names is sorted order: ")
for i in x:
print(i)


a = input("Input name1: ")
b = input("Input name2: ")
c = input("Input name3: ")
sortnames(a, b, c)

33 changes: 33 additions & 0 deletions Bishal/Day1Question3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
def prime(a) -> bool:
c = 0
for i in range(a + 1):
if a % (i + 1) == 0:
c += 1
if c == 2:
return True


def palin(b) -> bool:
d = b
s = 0
while b != 0:
div = b % 10
s = s * 10 + div
b = b // 10
if d == s:
return True


number = int(input("Enter a number: "))
bo = prime(number)
boo = palin(number)
if bo and boo:
print("Prime Palindrome.")
elif bo:
print("Only Prime.")
elif boo:
print("Only Palindrome.")
else:
print("Neither Prime nor Palindrome.")


11 changes: 11 additions & 0 deletions Bishal/Day1Question4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def printing():
c = """
Hello World!
I am Bishal Kumar Ghosh.
I've just kick-started learning.
"""
print(c)


printing()

12 changes: 12 additions & 0 deletions Bishal/Day1Question5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def flickingif(n):
if not(n > 0):
print(f"{n} is positive.")
elif not(n < 0):
print(f"{n} is negative.")
else:
print(f"{n} is Zero.")


no = int(input("Enter a number: "))
flickingif(no)

15 changes: 15 additions & 0 deletions Bishal/Day1Question6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def summation(li):
s: int = 0
for j in li:
s += j
return s


n = int(input("Enter for how many numbers you want to compute the sum: "))
print(f"Enter {n} numbers to get the desired sum: ")
numbers = []
for i in range(n):
numbers.append(int(input()))
sum1 = summation(numbers)
print(sum1)

28 changes: 28 additions & 0 deletions Bishal/Day1Question7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import math

import matplotlib.pyplot as plt


def pl(li1):
plt.plot(li1)
plt.show()


def xcal(li2):
for i in range(len(li2)):
li2[i] = math.sqrt(li2[i])
return li2


def inp():
n = int(input("Enter how many numbers you wanna enter: "))
print(f"Now, enter {n} numbers: ")
li3 = []
for i in range(n):
li3.append(int(input()))
return li3


lx = inp()
m = xcal(lx)
pl(m)
19 changes: 19 additions & 0 deletions Bishal/Day1Question8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
def deladdnumb():
n = int(input("Enter the number of numbers you wanna enter: "))
li = []
print(f"Enter {n} numbers:")
for i in range(n):
li.append(int(input()))
temp = [li[0]]
for i in range(1, n):
c = 0
for j in range(i):
if li[i] == li[j]:
c += 1
if c != 1:
temp.append(li[i])
print(f"Before Deletion: {li}")
print(f"After Deletion: {temp}")


deladdnumb()
20 changes: 20 additions & 0 deletions Bishal/Day1Question9.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class Student:
def __init__(self, age, height, weight, gender):
self.age = age
self.height = height
self.weight = weight
self.gender = gender

@staticmethod
def intro(first, sur):
print(f"\n\nName: {first} {sur}")


b = input("Enter first name: ")
m = input("Enter surname: ")
specifications = Student(input("Enter Age(years): "), input("Enter Height(feet): "), input("Enter Weight(kgs): "), input("Enter Gender: "))
specifications.intro(b, m)
print(f"Gender: {specifications.gender} ")
print(f"Age: {specifications.age} years")
print(f"Height: {specifications.height} feet")
print(f"Weight: {specifications.weight} kgs")
36 changes: 36 additions & 0 deletions Bishal/Day2Question1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Working with timedelta objects
from datetime import date
from datetime import datetime
from datetime import timedelta

print(timedelta(days=60, hours=4, minutes=21, seconds=17))

# today's date
now = datetime.now()
print("Today is:\n" + str(now))

# after a year
print("After 1 year:\n" + str(now + timedelta(days=365)))

# after 2 days 3 weeks
print("After 2 days and :\n" + str(now + timedelta(days=2, weeks=3)))

# 1week ago
t = datetime.now() - timedelta(weeks=1)
s = t.strftime("%A %B %d, %Y")
print("A week ago: " + s)

# How many days until Jan 01
today = date.today()
nov = date(today.year, 11, 6)

# If for this date has already occurred before today
if nov < today:
print("6th Nov has went by %d days ago" % (today - nov).days)
nov = nov.replace(year=today.year + 1)

# Now calculating for the next year's 6th Nov
time_to_nov = nov - today
print("It's just", time_to_nov.days, "days until next 6th Nov.")

#
8 changes: 8 additions & 0 deletions Bishal/Day2Question2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Working with Calenders
import calendar

# Plain text calender
c = calendar.TextCalendar(calendar.MONDAY)
st = c.formatmonth(2017, 1, 0, 0)
print(st)

16 changes: 16 additions & 0 deletions Bishal/Day2Question3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Opening a New File
file = open("Text.txt", "w+")
for i in range(10):
file.write(str(i+1) + ". Hello World! It's me.\nI'm here to learn something new.\n")
file.close()

# Appending
f = open("Text.txt", "a")
f.write("Yo!")
f.close()

# Opening the file back up and read the contents
f = open("Text.txt", "r")
if f.mode == 'r':
contents = f.read()
print(contents)
30 changes: 30 additions & 0 deletions Bishal/Day2Question4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Working with os.path module
import os
from os import path
import datetime
import time


def main():
# Printing the name of the oS
print(os.name)
print(os.path)


main()

# Check for item existence and type
print("Item exists (Text.txt): "+str(path.exists("Text.txt")))
print("Item is a file (Text.txt): "+str(path.isfile("Text.txt")))
print("Item is a directory (Text.txt): "+str(path.isdir("Text.txt")))
print("Item is a directory (My_File): "+str(path.isdir("My_File")))

# Work with file paths
print("Item path: " + str(path.realpath("Text.txt")))
print("Item path and name: " + str(path.split(path.realpath("Text.txt"))))

# Get the modification time
t = time.ctime(path.getmtime("Text.txt"))
print(t)
print(datetime.datetime.fromtimestamp(path.getctime("Text.txt")))

21 changes: 21 additions & 0 deletions Bishal/Text.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
1. Hello World! It's me.
I'm here to learn something new.
2. Hello World! It's me.
I'm here to learn something new.
3. Hello World! It's me.
I'm here to learn something new.
4. Hello World! It's me.
I'm here to learn something new.
5. Hello World! It's me.
I'm here to learn something new.
6. Hello World! It's me.
I'm here to learn something new.
7. Hello World! It's me.
I'm here to learn something new.
8. Hello World! It's me.
I'm here to learn something new.
9. Hello World! It's me.
I'm here to learn something new.
10. Hello World! It's me.
I'm here to learn something new.
Yo!
1 change: 1 addition & 0 deletions Bishal/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
##Java and Python and C and C++ and Ruby