diff --git a/Codes/24HourClock.py b/Codes/24HourClock.py new file mode 100644 index 0000000..adc027d --- /dev/null +++ b/Codes/24HourClock.py @@ -0,0 +1,22 @@ +#Execute this through command prompt/ terminal using this command: python 24HourClock.py or python3 24HourClock.py + + +#Python's input function always returns a string data which is assigned to variables currentTime and delayTime here. +currentTime = input("What's the current time (24 Hours clock) ? ") +delayTime = input("Alarm must ring after how many hours ? ") + +#But to perform calculations we HAVE to convert string data into integer + +#And that is done by writing +# (int)(String_name) +# Suppose a = "4" +# Then if we write print(a+2) expecting it to print 6, but instead it prints 42. That's because It converts 2 to a string and then concatenates it to "4" which is a string. +# Try to google these fancy words like concatenation and ofcourse we're always there for you. + +#So what we do is to convert a from string to an int +#that's done by a = (int)(a) +# Now a = 4, quotes removed and string converted to int + +#So that's why here we have written (int)(currentTime) and int(delayTime) +waitTime = (int(currentTime) + (int(delayTime) % 24))%24 +print("Alarm time will be", waitTime, "hours.") diff --git a/Codes/calculator.py b/Codes/calculator.py new file mode 100644 index 0000000..1839c6c --- /dev/null +++ b/Codes/calculator.py @@ -0,0 +1,39 @@ +def add(x, y): + return x + y + #Evaluates x + y and returns the INTEGER result back to the point where this function was called from. + +def sub(a, b): + return a - b + +def mult(p, r): + return p * r + +def div(a, b): + return a / b + +def remainder(m,n): + return m % n + +print(" ** CALCULATOR ** ") +print("Enter two numbers") +a = input() +b = input() + +#Suppose user enters 3 and 5, Then a = "3", b = "5", "3" and "5" are strings +#But we need a = 3, and not "3" and b = 5, and not "5", so that they become integers and then we can perform arithmetic operations. + +a = int(a) # This line converts whatever is stored in a to INTEGER Type and assigns that value to a. +b = int(b) # This line converts whatever is stored in b to INTEGER Type and assigns that value to b again. + +#SO simply put, int function converts variables to INTEGER data type +# And similiarly, there is a str() function which converts variables to STRING data type + +print("\n\nResults!") + +# Suppose I entered a=1, b=2 then this happens, + +print(add(a,b)) #Addition, add(a,b) becomes --> 3, 3 gets printed on screen. +print(sub(a,b)) #Subtraction, sub(a,b) --> -1 +print(div(a,b)) #Division, div(a,b) --> 0 +print(mult(a,b)) #Multiplication, mult(a,b) -> 2 +print(remainder(a,b)) #Remainder, remainder(a,b) -> 1 diff --git a/Codes/daysOfWeek.py b/Codes/daysOfWeek.py new file mode 100644 index 0000000..6be17c4 --- /dev/null +++ b/Codes/daysOfWeek.py @@ -0,0 +1,11 @@ +""" +It is possible to name the days 0 through 6 where day 0 is Sunday and day 6 is Saturday. If you go on a wonderful holiday leaving on day number 3 (a Wednesday) and you return home after 10 nights. Write a general version of the program which asks for the starting day number, and the length of your stay, and it will tell you the number of day of the week you will return on. + +""" + +starting = input("Starting Day ?") +lengthOfStay = input("Length of stay ?") + +returnDay = (int(starting) % 7 + int(lengthOfStay)%7 ) % 7 + +print("Day of return", returnDay) diff --git a/Codes/degreeAndFahreinheit.py b/Codes/degreeAndFahreinheit.py new file mode 100644 index 0000000..ee0bffd --- /dev/null +++ b/Codes/degreeAndFahreinheit.py @@ -0,0 +1,2 @@ +degree =float(input("Enter degree = ?")) +print("Fahreinheit", degree*(9/5) + 32) diff --git a/Codes/print.py b/Codes/print.py new file mode 100644 index 0000000..e69de29 diff --git a/Codes/simpleInterest.py b/Codes/simpleInterest.py new file mode 100644 index 0000000..c6cca05 --- /dev/null +++ b/Codes/simpleInterest.py @@ -0,0 +1,10 @@ +""" +Compute final amount using formula of compound interest +""" + +principal =int( input("Principal Amount ? ")) +rate =int (input("Annual nominal interest rate ? ")) +compoundCount = int( input("Number of times the interest is compounded per year ? ")) +time = int(input("Number of years ?")) + +print ("Amount = Rs", principal * ( (1 + rate/compoundCount)** (compoundCount * time))) diff --git a/1.jpg b/Slides/1.jpg similarity index 100% rename from 1.jpg rename to Slides/1.jpg diff --git a/2.png b/Slides/2.png similarity index 100% rename from 2.png rename to Slides/2.png diff --git a/3.png b/Slides/3.png similarity index 100% rename from 3.png rename to Slides/3.png diff --git a/css/print/paper.css b/Slides/css/print/paper.css similarity index 100% rename from css/print/paper.css rename to Slides/css/print/paper.css diff --git a/css/print/pdf.css b/Slides/css/print/pdf.css similarity index 100% rename from css/print/pdf.css rename to Slides/css/print/pdf.css diff --git a/css/reveal.css b/Slides/css/reveal.css similarity index 100% rename from css/reveal.css rename to Slides/css/reveal.css diff --git a/css/reveal.min.css b/Slides/css/reveal.min.css similarity index 100% rename from css/reveal.min.css rename to Slides/css/reveal.min.css diff --git a/css/theme/README.md b/Slides/css/theme/README.md similarity index 100% rename from css/theme/README.md rename to Slides/css/theme/README.md diff --git a/css/theme/beige.css b/Slides/css/theme/beige.css similarity index 100% rename from css/theme/beige.css rename to Slides/css/theme/beige.css diff --git a/css/theme/blood.css b/Slides/css/theme/blood.css similarity index 100% rename from css/theme/blood.css rename to Slides/css/theme/blood.css diff --git a/css/theme/default.css b/Slides/css/theme/default.css similarity index 100% rename from css/theme/default.css rename to Slides/css/theme/default.css diff --git a/css/theme/moon.css b/Slides/css/theme/moon.css similarity index 100% rename from css/theme/moon.css rename to Slides/css/theme/moon.css diff --git a/css/theme/night.css b/Slides/css/theme/night.css similarity index 100% rename from css/theme/night.css rename to Slides/css/theme/night.css diff --git a/css/theme/serif.css b/Slides/css/theme/serif.css similarity index 100% rename from css/theme/serif.css rename to Slides/css/theme/serif.css diff --git a/css/theme/simple.css b/Slides/css/theme/simple.css similarity index 100% rename from css/theme/simple.css rename to Slides/css/theme/simple.css diff --git a/css/theme/sky.css b/Slides/css/theme/sky.css similarity index 100% rename from css/theme/sky.css rename to Slides/css/theme/sky.css diff --git a/css/theme/solarized.css b/Slides/css/theme/solarized.css similarity index 100% rename from css/theme/solarized.css rename to Slides/css/theme/solarized.css diff --git a/css/theme/source/beige.scss b/Slides/css/theme/source/beige.scss similarity index 100% rename from css/theme/source/beige.scss rename to Slides/css/theme/source/beige.scss diff --git a/css/theme/source/blood.scss b/Slides/css/theme/source/blood.scss similarity index 100% rename from css/theme/source/blood.scss rename to Slides/css/theme/source/blood.scss diff --git a/css/theme/source/default.scss b/Slides/css/theme/source/default.scss similarity index 100% rename from css/theme/source/default.scss rename to Slides/css/theme/source/default.scss diff --git a/css/theme/source/moon.scss b/Slides/css/theme/source/moon.scss similarity index 100% rename from css/theme/source/moon.scss rename to Slides/css/theme/source/moon.scss diff --git a/css/theme/source/night.scss b/Slides/css/theme/source/night.scss similarity index 100% rename from css/theme/source/night.scss rename to Slides/css/theme/source/night.scss diff --git a/css/theme/source/serif.scss b/Slides/css/theme/source/serif.scss similarity index 100% rename from css/theme/source/serif.scss rename to Slides/css/theme/source/serif.scss diff --git a/css/theme/source/simple.scss b/Slides/css/theme/source/simple.scss similarity index 100% rename from css/theme/source/simple.scss rename to Slides/css/theme/source/simple.scss diff --git a/css/theme/source/sky.scss b/Slides/css/theme/source/sky.scss similarity index 100% rename from css/theme/source/sky.scss rename to Slides/css/theme/source/sky.scss diff --git a/css/theme/source/solarized.scss b/Slides/css/theme/source/solarized.scss similarity index 100% rename from css/theme/source/solarized.scss rename to Slides/css/theme/source/solarized.scss diff --git a/css/theme/template/mixins.scss b/Slides/css/theme/template/mixins.scss similarity index 100% rename from css/theme/template/mixins.scss rename to Slides/css/theme/template/mixins.scss diff --git a/css/theme/template/settings.scss b/Slides/css/theme/template/settings.scss similarity index 100% rename from css/theme/template/settings.scss rename to Slides/css/theme/template/settings.scss diff --git a/css/theme/template/theme.scss b/Slides/css/theme/template/theme.scss similarity index 100% rename from css/theme/template/theme.scss rename to Slides/css/theme/template/theme.scss diff --git a/index.html b/Slides/index.html similarity index 100% rename from index.html rename to Slides/index.html diff --git a/js/reveal.js b/Slides/js/reveal.js similarity index 100% rename from js/reveal.js rename to Slides/js/reveal.js diff --git a/js/reveal.min.js b/Slides/js/reveal.min.js similarity index 100% rename from js/reveal.min.js rename to Slides/js/reveal.min.js diff --git a/lib/css/zenburn.css b/Slides/lib/css/zenburn.css similarity index 100% rename from lib/css/zenburn.css rename to Slides/lib/css/zenburn.css diff --git a/lib/font/league_gothic-webfont.eot b/Slides/lib/font/league_gothic-webfont.eot similarity index 100% rename from lib/font/league_gothic-webfont.eot rename to Slides/lib/font/league_gothic-webfont.eot diff --git a/lib/font/league_gothic-webfont.svg b/Slides/lib/font/league_gothic-webfont.svg similarity index 100% rename from lib/font/league_gothic-webfont.svg rename to Slides/lib/font/league_gothic-webfont.svg diff --git a/lib/font/league_gothic-webfont.ttf b/Slides/lib/font/league_gothic-webfont.ttf similarity index 100% rename from lib/font/league_gothic-webfont.ttf rename to Slides/lib/font/league_gothic-webfont.ttf diff --git a/lib/font/league_gothic-webfont.woff b/Slides/lib/font/league_gothic-webfont.woff similarity index 100% rename from lib/font/league_gothic-webfont.woff rename to Slides/lib/font/league_gothic-webfont.woff diff --git a/lib/font/league_gothic_license b/Slides/lib/font/league_gothic_license similarity index 100% rename from lib/font/league_gothic_license rename to Slides/lib/font/league_gothic_license diff --git a/lib/js/classList.js b/Slides/lib/js/classList.js similarity index 100% rename from lib/js/classList.js rename to Slides/lib/js/classList.js diff --git a/lib/js/head.min.js b/Slides/lib/js/head.min.js similarity index 100% rename from lib/js/head.min.js rename to Slides/lib/js/head.min.js diff --git a/lib/js/html5shiv.js b/Slides/lib/js/html5shiv.js similarity index 100% rename from lib/js/html5shiv.js rename to Slides/lib/js/html5shiv.js