def print_seconds_day (days):
hours= days*24
minutes=hours*60
seconds = minutes*60
print (seconds)
print_seconds_day(4)
def convert_days_to_seconds (days):
hours=days*24
minutes=hours*60
seconds = minutes*60
print (seconds)
return seconds
totalsec = convert_days_to_seconds (5)
millisec = totalsec*1000
print (millisec)
import random
import string
adjectives = ['sleepy', 'slow', 'hot',
'cold', 'big', 'red',
'orandge', 'yellow', 'green',
'blue', 'good', 'old',
'white', 'free', 'brave']
nouns = ['apple', 'dinosaur', 'ball', 'cat', 'goat', 'dragon', 'car', 'duck', 'panda']
print ('Добро пожаловать!')
adjective = random.choice (adjectives)
noun = random.choice (nouns)
number = random.randrange(0,100)
special_char = random.choice (string.punctuation)
password = adjective + noun + str(number) + special_char
print ('Новый пароль: %s ' % password)
import random
import string
adjectives = ['sleepy', 'slow', 'hot', 'cold', 'big',
'red', 'orandge', 'yellow', 'green',
'blue', 'good', 'old',
'white', 'free', 'brave']
nouns = ['apple', 'dinosaur', 'ball', 'cat', 'goat', 'dragon', 'car', 'duck', 'panda']
print ('Добро пожаловать!')
while True:
adjective = random.choice (adjectives)
noun = random.choice (nouns)
number = random.randrange(0,100)
special_char = random.choice (string.punctuation)
password = adjective + noun + str(number) + special_char
print ('Новый пароль: %s ' % password)
response=input ('Сгенерировать другой пароль? д/н ')
if response == 'н':
break
dinner = input ('Что ты хочешь на ужин? пицца/паста/пирожки ')
if dinner == 'пицца':
print ('Хорошо, она будет с пеперони)))')
elif dinner == 'паста':
print ('Отличный выбор! Я приготовлю карбонару ')
else:
print ('Ммммммм замечательно!')
import random
lives = 9
words = ['мираж', 'пицца', 'ангел', 'носки', 'выдра', 'петух']
secret_word = random.choice(words)
clue = list ('?????')
heart_symbol = u'\u2764'
guessed_word_correctly = False
def update_clue (guessed_letter, secret_word, clue):
index = 0
while index < len(secret_word):
if guessed_letter == secret_word[index]:
clue[index] = guessed_letter
index = index + 1
while lives>0:
print (clue)
print ('Осталосб жизней: ' + heart_symbol * lives)
guess = input ('Угадайте букву или слово: ')
if guess == secret_word:
guessed_word_correctly = True
break
if guess in secret_word:
update_clue (guess, secret_word, clue)
else:
print ('Неправильно((( Вы потеряли жизнь...')
lives = lives-1