-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentaion For Some Codes aare Updated
Documentaion For Some Codes aare Updated with some comment for better Code-Reading.
- Loading branch information
1 parent
432f747
commit 5514bd9
Showing
21 changed files
with
135 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
''' | ||
Check you name contain vowel Or Not Using python intersection function. | ||
''' | ||
|
||
def names(): | ||
name = str(input("Please! Enter Your Name")) | ||
name = input("Please! Enter Your Name\n") #Enter Your name | ||
|
||
if set('aeiou').intersection(name.lower()): | ||
print("Your Name Contains a vowel") | ||
else : | ||
print("Your Name doesn't have a vowel") | ||
|
||
for letter in names: | ||
for letter in name: # For Loop To Check Letter | ||
print(letter) | ||
|
||
|
||
names() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
''' | ||
Standard deviation is a number that describes how spread out the values are. | ||
A low standard deviation means that most of the numbers are close to the mean (average) value. | ||
A high standard deviation means that the values are spread out over a wider range. | ||
Example: This time we have registered the speed of 7 cars: | ||
''' | ||
import numpy | ||
|
||
speed = [86,87,88,86,87,85,86] | ||
|
||
x = numpy.std(speed) | ||
|
||
print(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
Pandas/creating pandas dataframe from list using dictionary.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
import random | ||
start = input("First Choose your Range for Number guessing\nlike 1 to 20\nEnter To Start Game For Number Guess ") | ||
''' | ||
Number Guessing Game In Python Without Gui Using Random and User_Input Fucntion in Python 3.8 | ||
''' | ||
import random | ||
input("First Choose your Range for Number guessing\nlike 1 to 20\nEnter To Start Game For Number Guess ") | ||
lower_range =int(input("Enter Your Lower Range To Start Guessing Game: \n")) | ||
upper_range =int(input("Enter Your Upper Range To Start Guessing Game: \n")) | ||
for i in range(10): | ||
ran_num = random.randint(lower_range,upper_range) | ||
|
||
ran_num = random.randint(lower_range,upper_range) | ||
#print(ran_num) To print Random Number For Debugging Purpose. | ||
''' | ||
Random : import random for generate random number between Lower Range TO Upper Range | ||
Input : input Fucntion for take user input | ||
Lower Range : Lower Range for randomly Generated Number | ||
Upper Range : Upper Range For Randomly Generated Number | ||
ran_num = Random Number Generated In Saved In ran_num Variable for Check With User Input | ||
''' | ||
|
||
num = int(input("Please Enter Your Guess Number :\n")) | ||
while True: | ||
if num == ran_num: | ||
if num == ran_num: # Checking User Input with Random Generated Number | ||
print("You Guess Right Number") | ||
break | ||
else: | ||
print("Your Guess Was Wrong") | ||
print("Your Guess Was Wrong") # if ran_num was not same as User Input. | ||
break | ||
print("The Real Number Was {}".format (ran_num)) | ||
print("The Real Number Was {}".format (ran_num)) # To Print The Random Generated Number . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
'''A Prime Number is a natural number greater than 1 that has no positive divisors other than 1 and itself. | ||
The first few prime number are {2,3,5,7,11} | ||
''' | ||
|
||
a = 1 | ||
b = 30 | ||
|
||
input("Enter Your Range For Print Number \nLower Range \n Upper Range\n Like 1 to 20") | ||
a = int(input("Lower Range :\n ")) | ||
b = int(input("Upper Range :\n ")) | ||
solution =[] | ||
''' | ||
a = Lower Range | ||
b = Upper Range | ||
solution = a list to contain prime Number | ||
''' | ||
print("-"*20) | ||
for val in range(a, b + 1): | ||
if val >1: | ||
for n in range(2, val): | ||
for n in range(2, int(val**0.5)): | ||
if ( val % n) == 0: | ||
break | ||
|
||
else: | ||
print(val) | ||
solution.append(val) | ||
|
||
print(solution) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
''' | ||
Python program to find factorial of given number | ||
Factorial of n | ||
n = n*(n-1)*(n-2)*(n-3).......3*2*1 | ||
4 = 4*3*2*1 = 24 | ||
''' | ||
def factorial(n): | ||
#Line to Find Factorial | ||
return 1 if (n==1 or n==0) else n * factorial(n -1); | ||
|
||
#Driver Code | ||
num = 5; | ||
print("Factorial of ",num,"is", | ||
factorial(num)) | ||
num = int(input(" Enter Number For Factorial :\n")) | ||
answer = factorial(num) | ||
print(f"Factorial of {num} is {answer}.") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
''' | ||
python programfor convert text to speech | ||
gTTS = Google Text to Speech | ||
''' | ||
from gtts import gTTS | ||
import os | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
''' | ||
Password Generation Using Random Function in Python. | ||
Random is python module to generate random value or select random vlaue from list, string. | ||
''' | ||
import random | ||
list = [] | ||
|
||
s = "abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()?" | ||
passlen = int(input("Enter Length to Genrate Password:\n")) | ||
if passlen<6: | ||
print("Choose 6 or Greater") | ||
else: | ||
p = "".join(random.sample(s,passlen )) | ||
print (p) | ||
n = int(input("How Many Password Your Want to print :\n")) | ||
''' | ||
passlen = Length of password . Password Length should be greater than 8 | ||
n = Number of password for your project | ||
s = symbol and letter for auto-generation password | ||
''' | ||
for i in range(n): | ||
if passlen<8: | ||
print("Choose 8 or Greater") | ||
else: | ||
p = "".join(random.sample(s,passlen)) | ||
list.append(p) # append Password in list | ||
print(list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
''' | ||
python programe to check if a string is palindrome | ||
or not''' | ||
Python Programe To Check if a String is Palindrome or Not | ||
''' | ||
|
||
x = "211112" | ||
w = "" | ||
check1 = input("Choose Your Input For Check Palindrome\n For Integer Type --> i \n For Word Type -->s\n").lower() | ||
for i range(1,3): | ||
if check1 == 's': | ||
x = input("Enter Your Word Here :\n").lower() | ||
elif check1 == 'i': | ||
x = input("Enter Your Number Here :\n") | ||
else: | ||
print("Please Enter I or S only") | ||
|
||
# save string x to a new new variable and compare them | ||
for i in x: | ||
w = i + w | ||
#print(w) | ||
if (x==w): | ||
print("Yes") | ||
break | ||
w = "" # Empty String to save Reverse value in it. | ||
|
||
else: | ||
print("No") | ||
#save string x to a new new variable and compare them | ||
for i in x: | ||
w = i + w # save new value to w | ||
if (x==w): | ||
print("Yes") | ||
break | ||
else: | ||
print("No") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,15 @@ | ||
''' | ||
Given a positive integer N. The task is to find 12 + 22 + 32 + ….. + N2. | ||
if N = 4 | ||
1^2 + 2^2 + 3^2 + 4^2 | ||
The idea is to run a loop from 1 to n and for each i, 1 <= i <= n, find i2 to sum. | ||
1^2 + 2^2 + 3^2 + 4^2 = 30 | ||
The idea is to run a loop from 1 to n and for each i, 1 <= i <= n, find i2 to sum. | ||
''' | ||
|
||
def squaresum(n): | ||
|
||
sum = 0 | ||
for i in range(1, n+1): | ||
sum = sum + (i * i) | ||
|
||
sum += (i * i) | ||
return sum | ||
|
||
n = 4 | ||
print(squaresum(n)) | ||
|
||
n = int(input("Enter Number to Print Sum Of square of N Natural Number :\n")) | ||
print(squaresum(n)) |