Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import название_модуля
- # или
- import main
- import random
- a = random.randint(0, 10)
- print(a)
- import random
- shop = ["молоко", "колбаса", "сыр"]
- ch = random.choice(shop)
- print(ch)
- import time
- print(1)
- time.sleep(2)
- print(3)
- import datetime
- print(datetime.datetime.now().hour)
- print(datetime.datetime.now().minute)
- print(datetime.datetime.now().second)
- print(datetime.datetime.now().year)
- print(datetime.datetime.now().month)
- print(datetime.datetime.now().day)
- import random
- dictionary = {
- "Слива": "12 ккал",
- "Банан": "120 ккал",
- "Яблоко": "54 ккал",
- "Snickers": "132 ккал"
- }
- keys = list(dictionary.keys())
- rnd = random.choice(keys)
- print("%s: %s" % (rnd, dictionary[rnd]))
- import time
- max = int(input("Введи количество секунд: "))
- timer = 0
- while timer != max:
- print("Прошла 1 секунда. Осталось", max - timer, "секунд.")
- time.sleep(1)
- timer += 1
- print("Дзынь-Дзынь")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement