Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Python kepzes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pál Boldizsár
Python kepzes
Commits
4b65f254
Commit
4b65f254
authored
5 years ago
by
Pál Boldizsár
Browse files
Options
Downloads
Patches
Plain Diff
harmadik feladat
parent
ebec44cd
Branches
Worhsop_eleje
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
DB/Database.py
+39
-0
39 additions, 0 deletions
DB/Database.py
first_task
+0
-6
0 additions, 6 deletions
first_task
first_task.py
+5
-4
5 additions, 4 deletions
first_task.py
with
44 additions
and
10 deletions
DB/Database.py
0 → 100644
+
39
−
0
View file @
4b65f254
"""
ez file lenne ami ossyekoti a db-t a programunkal. hogy egyszerubb legyen
az eletunk, ezert most csak egyszeru dictekbe, meg setekbe tarolunk mindent
"""
fake_db
=
{}
def
check_user_name
(
username
=
None
):
if
not
username
:
return
'
No name given
'
if
username
in
fake_db
[
'
u_names
'
]:
# legyen u_names a usernevek setje
return
'
Username taken
'
else
:
return
''
def
hasNumbers
(
inputString
):
return
any
(
char
.
isdigit
()
for
char
in
inputString
)
def
validate_password
(
password
=
None
):
if
isinstance
(
password
,
str
)
is
False
:
return
'
Bad password
'
elif
len
(
password
)
<
8
or
'
dick
'
in
password
:
return
'
Password is too short
'
elif
hasNumbers
(
password
)
is
False
:
return
'
must contain number
'
else
:
return
''
def
create_user
(
username
,
password
):
try
:
fake_db
[
'
u_names
'
].
add
(
username
)
fake_db
[
'
users
'
].
append
({
'
Username
'
:
username
,
'
Password
'
:
password
})
except
Exception
as
e
:
return
'
oopsie
'
,
e
return
True
This diff is collapsed.
Click to expand it.
first_task
deleted
100644 → 0
+
0
−
6
View file @
ebec44cd
>>> def Kiiro():
... print("gimme your name")
... txt = input()
... print(txt)
...
>>> Kiiro()
This diff is collapsed.
Click to expand it.
first_task.py
+
5
−
4
View file @
4b65f254
...
@@ -3,5 +3,6 @@ def Kiiro():
...
@@ -3,5 +3,6 @@ def Kiiro():
txt
=
input
()
txt
=
input
()
print
(
txt
)
print
(
txt
)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
Kiiro
()
Kiiro
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment