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
4 changes: 4 additions & 0 deletions basic_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import dice
ddice=dice.rollDice(int(input("Enter repetition number: ")))
for i in range(len(ddice)):
print("The probability of {} is {}%".format(i+1,ddice[i]))
7 changes: 7 additions & 0 deletions dice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from random import randint
def rollDice(number):
dice=[0,0,0,0,0,0]
for i in range(1,5001):
dice[randint(1,6)-1]+=1
for i in range(6):
print('Percentage of throws of value {} =: {:.2%}'.format((i+1),(dice[i]/5000)))
19 changes: 19 additions & 0 deletions gcd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from math import gcd
from functools import reduce
def inputs():
try:
global x,y
x=int(input("please,enter your first number:"))
y=int(input("please enter your second number:"))
except ValueError:
print("Please enter your number")

def Gcd():
return gcd(x,y)

if __name__ == '__main__':
inputs()


print(Gcd())

29 changes: 29 additions & 0 deletions password.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import re
password=input("Şifre giriniz:")
def Password(password):
x=True
while x:
if len(password)<6 or len(password)>16 :
raise ValueError("Password has to between 6-16 characters.")
elif not re.search("[a-z]",password):
raise ValueError ("Password must have at least 1 letter between [a-z]")
elif not re.search("[A-Z]",password):
raise ValueError("Password must have at least 1 letter between [A-Z]")
elif not re.search("[0-9]",password):
raise ValueError("Password must have at least 1 number between [0-9]")
elif not re.search("[$#@]",password):
raise ValueError("Password must have at least 1 charachter between [$#@]")
else:
print("Congratulations,Valid Password")
x=False
break

try:
Password(password)

except ValueError as V :
print(V)

finally:
print("Don't give up")