W
W
webratas2020-08-12 14:01:18
Python
webratas, 2020-08-12 14:01:18

What is wrong with python program?

what is wrong here (I just started to learn)

print("сбор данных")
name=input ('Имя')
famil=input ('Фамилия')
fath=input ('Отчество')
age=input ('Возраст')
cont=input ('Страна')
city=input ('Город')
plase=input ('Район')
street=input ('Улица')
home=input ('Дом')
print("сбор...")
print("кеширвание...")
print("сохранение...")
print("шифрование...")
print("готово.")
permission=input('хотите прочесть файл y/n')
if permission=y:
    print(name)
    print(famil)
    print(fath)
    print(age)
    print(cont)
    print(city)
    print(plase)
    print(street)
    print(home)
else:
  print("not permission")
input('press e and enter to exit')

error on "=", "invalid sintax?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Ronald McDonald, 2020-08-12
@webratas

You have:
if permission=y:
but it is necessary:
if permission=='y':
​​In the condition - double "equals", in the assignment - single.

M
Man like everyone, 2020-08-12
else @Cheloveck

Need if permission=='y':

A
Alan Gibizov, 2020-08-12
@phaggi

Should be:
if permission == “y”:
In general, I recommend reading the book "Learning Python" by Mark Lutz. Everything is very well dismantled, even chewed. True, the book is big.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question