Variables | Print | Input

Python for beginners

Here I’ll show you how to make a simple variable, print it and get input:


names = ['Alex','Tony','Andry','Angie','Kate']
print ("Hello, what is your name?")
myname = input()
myname = myname.lower()
found = 0
for name in names:
    thename = name.lower()
    if myname == thename:
        print('Hello' + myname.capitalize() + '. Nice to see you again!')
        found = 1
        break
if found == 0:
    print ('We have checked ' + len(names) + ' names, and have not found you, ' + myname.capitalize() + ' there. Sorry.')

Warning: Attempt to read property "ID" on string in /home/dh_nnh83a/itisuni.com/wp-content/themes/mytheme/single.php on line 84

Warning: Undefined variable $my_category_ids in /home/dh_nnh83a/itisuni.com/wp-content/themes/mytheme/single.php on line 106
Python for beginners Text or number? | INT or STRING? Python for beginners IF | ELIF | ELSE