"Current date and time : "


Download 12.96 Kb.
Sana14.11.2021
Hajmi12.96 Kb.
#173694

1).

import datetime

now = datetime.datetime.now()

print ("Current date and time : ")

print (now.strftime("%Y-%m-%d %H:%M:%S"))

  1. .Напишите программу Python, которая принимает целое число (n) и вычисляет значение n + nn + nnn.

a = int(input("Input an integer : "))

n1 = int( "%s" % a )

n2 = int( "%s%s" % (a,a) )

n3 = int( "%s%s%s" % (a,a,a) )



print (n1+n2+n3)
Download 12.96 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling