Python Forum
Printing strings.. help..
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Printing strings.. help..
#1
My first defined function works, however I can't get my second defined function to work. I need my main function to access the upperCase function and then print everything in all caps. For example the user enters in hi, I need my program to convert that to HI. For the love of god I can't figure out where I am going wrong. Can anybody show me? Thanks.

Also, how can I get my program to run nonstop? I'm kind of new with looping. 



def reverse(text):
    rev_text = ""
    for i in text:
        rev_text = i + rev_text
    return rev_text


def upperCase(text1):
    text1 = s.upper()
    return text1


def main():
    
    text = str(input("Enter a text: "))
    print(reverse(text))

    text1 = str(input("Enter a number again: "))
    print(upperCase(text1))


main()
Reply


Messages In This Thread
Printing strings.. help.. - by zepel - May-17-2017, 03:00 PM
RE: Printing strings.. help.. - by metulburr - May-17-2017, 03:06 PM
RE: Printing strings.. help.. - by zepel - May-17-2017, 04:28 PM
RE: Printing strings.. help.. - by nilamo - Aug-14-2017, 07:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Strings inside other strings - substrings OmarSinno 2 3,791 Oct-06-2017, 09:58 AM
Last Post: gruntfutuk

Forum Jump:

User Panel Messages

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