Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Задача 5 (FOR)
- start_index = int(input())
- stop_index = int(input())
- for index in range(start_index, stop_index + 1):
- ascii_char = chr(index)
- print(ascii_char, end=' ')
- # Задача 6 (Triple FOR) ord('a')
- n = int(input())
- collection = []
- for code in range(ord('a'), n + ord('a')):
- collection.append(chr(code))
- for first_char in collection:
- for second_char in collection:
- for third_char in collection:
- print(f'{first_char}{second_char}{third_char}')
- # Задача 7 (FOR)
- CAPACITY = 255 # liters
- n_lines = int(input())
- total_liters = 0
- for line in range(1, n_lines + 1):
- add_liters = int(input())
- if total_liters + add_liters > CAPACITY:
- print('Insufficient capacity!')
- continue
- else:
- total_liters += add_liters
- print(total_liters)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement