vendredi 5 juillet 2019

How to run statment if a user input is str or int [duplicate]

This question already has an answer here:

Let me say about my program

  1. It will take a user input
  2. It will check its int or str
  3. if it is str it will say, Please enter a number !
  4. if it is int it will simply print, this is your + user input

Notice : I also need help for the 4th option i don't know how to print a str and that value in same line together

x = raw_input("Enter a Number : ")

if x == str:

    print "Please Use number"

else:

    print "This is your " + x

Aucun commentaire:

Enregistrer un commentaire