Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kurs_alx_pcz
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
kurs_alx_pcz
Commits
c20aeaf2
Commit
c20aeaf2
authored
Nov 16, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kalkulator1
parent
7abf7b9c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
kalkulator1.py
dzien2/kalkulator1.py
+9
-0
if.py
dzien2/teoria_if/if.py
+21
-0
No files found.
dzien2/kalkulator1.py
0 → 100644
View file @
c20aeaf2
x
=
int
(
input
(
'Podaj pierwszą liczbę: '
))
y
=
int
(
input
(
'Podaj drugą liczbę: '
))
op
=
input
(
'Podaj znak operacji: '
)
if
op
==
'+'
:
print
(
x
+
y
)
if
op
==
'-'
:
print
(
x
-
y
)
if
op
==
'*'
:
print
(
x
*
y
)
if
op
==
'/'
:
print
(
x
/
y
)
dzien2/teoria_if/if.py
View file @
c20aeaf2
...
@@ -51,3 +51,24 @@ else:
...
@@ -51,3 +51,24 @@ else:
print
(
'obie liczby są >= 50'
)
print
(
'obie liczby są >= 50'
)
# Generalnie nie należy przesadzać z poziomami zagnieżdżenia - im więcej, tym mniej czytelny program.
# Generalnie nie należy przesadzać z poziomami zagnieżdżenia - im więcej, tym mniej czytelny program.
# Operatory porównania:
# równe ==
if
x
==
y
:
print
(
'liczby są równe'
)
# nierówne
if
x
!=
y
:
print
(
'liczby nie są równe'
)
# < <= > >=
# element należy do zbioru:
miasta
=
[
'Warszawa'
,
'Wrocław'
,
'Poznań'
]
m
=
'Sochaczew'
if
m
in
miasta
:
print
(
f
'{m} należy do listy {miasta}'
)
else
:
print
(
f
'{m} nie należy do listy {miasta}'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment