Skip to content

Instantly share code, notes, and snippets.

@sunmeat
Created November 9, 2024 11:59
Show Gist options
  • Save sunmeat/8b9e0c65d724ecc4c4840408d0a47d10 to your computer and use it in GitHub Desktop.
Save sunmeat/8b9e0c65d724ecc4c4840408d0a47d10 to your computer and use it in GitHub Desktop.
приклад на введення даних в Python
name = input("Введiть ваше iм'я: ")
print(f"Привiт, {name}!")
age = int(input("Ваш вiк: "))
# price = float(input("Введiть цiну: "))
age = age + 1
print(age)
###########################################################
# продвинуте введення:
# data = input("Введiть числа через пробiл: ")
# numbers = [int(x) for x in data.split()]
# print(f"Числа: {numbers}")
# with open('C:/!Files/text/kobzar.txt', 'r') as file:
# data = file.read()
# print(f"Контент файлу:\n{data}")
# import getpass
# password = getpass.getpass("Введiть ваш пароль: ")
# print(f"Ваш пароль: {password}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment