Skip to content

Commit

Permalink
lesson 02
Browse files Browse the repository at this point in the history
  • Loading branch information
electronics-nik committed Nov 8, 2020
1 parent fcbfe7c commit 82a4a57
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lesson_02/escape_symb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""
\n
\t
\b
\"
\'
\\
"""
4 changes: 4 additions & 0 deletions lesson_02/formating_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tmp = 'User name: %s %s'
name = input('Please enter user name: ')
sur_name = input('Please enter user sur name: ')
print(tmp % (name, sur_name))
13 changes: 13 additions & 0 deletions lesson_02/func_input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# input()

a = input('Please enter a number (1-100): ')
print(a)
print(type(a))

# int()
# b = int(a)
# print(b, type(b))

# float()
c = float(a)
print(c, type(c))
13 changes: 13 additions & 0 deletions lesson_02/func_print.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
print('Some text')
print(45)
print(34.4)

print('Text', 56, 78.2)

# end
# sep

print('Text', 56, 78.2, sep=' <-> ')
print('Some text', end=' ')
print(45, end=' ')
print(34.4)
44 changes: 44 additions & 0 deletions lesson_02/type_of_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# int
a = 347856432789563478652347896534786543792563478563427563456234567351759463756347856856
print(a ** 2)
print(type(a))

print(0b010101001)
print(0o125326531)
print(0x345ABCDEF)

# float
print(0.1 + 0.1 + 0.1)
# min 2.23e-308 2.23 * 10 ^ -308
# max 1.79e+308 1.79 * 10 ^ +308

a = 3 ** 1000
print(a)
# b = a + 0.1
print(type(3.14))

# complex
a = (4 + 5j)
print(type(a))

# bool
a = True
b = False
print(type(a), type(b))

# str
a = 'reutyuiowert'
b = "utyoewiuyr"
print(type(a), type(b))

a = """
eruiyteruiogfkljds
;lguher;oiqgue
rekowgherhueriopgf
5474iohcv28o074ytpf
vihuorwyg45t9p34
"""
print(a)
print(type(a))

print(print.__doc__)
17 changes: 17 additions & 0 deletions lesson_02/variables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
print(56)

# print = 6
# print(78)

a = 6
a = b = c = 0
a, b, c = 4, 5, 6

x = 7
y = 8
tmp = x
x = y
y = tmp
x, y = y, x


0 comments on commit 82a4a57

Please sign in to comment.