Message in "print" is not printed on the screen, how to correct? [closed]

0

The print message does not appear on the screen, does it relate to the variable?

cp = str
input("seu nome")
if(cp)=='jefferson': print('JFP')
    
asked by anonymous 02.11.2018 / 18:34

1 answer

4

It's simpler than this.

if input("seu nome") == "jefferson": print("JFP")

See running on ideone . And in Coding Ground . Also put it in GitHub for future reference .

Do you have a reason to create a variable? If it has not do not create. Do not actually put anything in the code if you can not justify it.

I imagine you wanted to convert what was typed into string . But what, if what was typed is already a string ? And it has incomplete syntax on separate lines. I suggest to better understand how the basic syntax of things works, what is the function of each part of the code, because it is using each character. Without understanding these things you will never be able to program with dexterity.

    
02.11.2018 / 18:51