Answer the question
In order to leave comments, you need to log in
How to move all code to 1 line?
Help, I need to make all this code so that it is in one line
name = input("Enter your first name!")
surname = input("Enter your last name!")
date_of_birth = input("Enter your date of birth!")
username = input("Enter your username!")
password = input("Enter your password!")
print(name, surname)
print(date_of_birth)
print(username, password)
Answer the question
In order to leave comments, you need to log in
Is that so
print(input("Введите ваше имя!"));print(input("Введите вашу фамилию!")); print(input("Введите дату рождения!"));print(input("Введите имя пользователя!"));print(input("Введите пароль!"))
Crazy task:
name, surname, date_of_birth, username, password = input("введите имя фамилию ... через пробелы").split();print(name,surname,date_of_birth,username,password)
Easy!
print(
" ".join([input(f"Input your {i}: ") for i in ["name", "last name"]])
+ "\n"
+ input("Input your birth date: ")
+ "\n"
+ " ".join([input(f"Input your {i}: ") for i in ["user name", "password"]])
)
# Input your name: di
# Input your last name: k
# Input your birth date: 26
# Input your user name: w
# Input your password: sakfjs
# di k
# 26
# w sakfjs
Well, there are various ways, but if you need exactly what the code above does.
[(print(name, surname), print(date_of_birth), print(username, password)) for name, surname, date_of_birth, username, password in [ [input(f"Введите {ts}") for ts in ('ваше имя!', 'вашу фамилию!', 'дату рождения!', 'имя пользователя!', 'пароль!')] ] ]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question