Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Newbie Please
#6
With 'if' statements i can get to work.. the book I'm reading want me to use 'if','elif' and 'else' chain and thats where i run into problems. Thanks again
ord_nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9']
if ord_nums < '2':
    print str(ord_nums[0]) + 'st'
    if ord_nums < '3':
        print str(ord_nums[1]) + 'nd'
    if ord_nums < '4':
        print str(ord_nums[2]) + 'rd'
    if ord_nums < '5':
        print str(ord_nums[3]) + 'th'
    if ord_nums < '6':
        print str(ord_nums[4]) + 'th'
Reply


Messages In This Thread
Help Newbie Please - by JJG - Dec-01-2017, 05:12 AM
RE: Help Newbie Please - by Larz60+ - Dec-01-2017, 06:25 AM
RE: Help Newbie Please - by buran - Dec-01-2017, 07:54 AM
RE: Help Newbie Please - by Larz60+ - Dec-01-2017, 10:25 AM
RE: Help Newbie Please - by JJG - Dec-02-2017, 02:57 AM
RE: Help Newbie Please - by JJG - Dec-02-2017, 04:06 AM
RE: Help Newbie Please - by Larz60+ - Dec-02-2017, 07:24 AM
RE: Help Newbie Please - by JJG - Dec-06-2017, 02:44 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020