Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Return Multiple or one just
#14
when you print a tuple of 2 str elements, what you get is the representation of the str elements. That is why you see \n.

if you do
print('\n'.join(Runcode.screen()))
you get
Output:
<!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <!--Import Google Icon --> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <!--Import Material Design Icons--> <link href="https://cdn.materialdesignicons.com/2.8.94/css/materialdesignicons.min.css" rel="stylesheet"> <!--Import Google Font --> <link href="https://fonts.googleapis.com/css?family=Catamaran&display=swap" rel="stylesheet"> <!-- Favicon --> <link href="" rel="shortcut icon"/> <!--Import framework bootstrap--> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <!--Custom framework design--> <link href="http://127.0.0.1:8080/document/assets/css/custom.css" rel="stylesheet" type="text/css"> <!-- Page Title --> <title>document</title> </head> <body> <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script> </body> </html>
or you can assign the returned values to names and work with these
my_header, my_footer = Runcode.screen()
print(my_header)
print(my_footer)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Return Multiple or one just - by JohnnyCoffee - Apr-29-2020, 07:33 PM
RE: Return Multiple or one just - by deanhystad - Apr-29-2020, 07:56 PM
RE: Return Multiple or one just - by JohnnyCoffee - Apr-30-2020, 09:19 AM
RE: Return Multiple or one just - by buran - Apr-30-2020, 09:48 AM
RE: Return Multiple or one just - by JohnnyCoffee - Apr-30-2020, 11:39 AM
RE: Return Multiple or one just - by buran - Apr-30-2020, 01:00 PM
RE: Return Multiple or one just - by JohnnyCoffee - Apr-30-2020, 03:11 PM
RE: Return Multiple or one just - by deanhystad - Apr-30-2020, 01:02 PM
RE: Return Multiple or one just - by deanhystad - Apr-30-2020, 03:19 PM
RE: Return Multiple or one just - by JohnnyCoffee - Apr-30-2020, 09:15 PM
RE: Return Multiple or one just - by buran - Apr-30-2020, 04:01 PM
RE: Return Multiple or one just - by buran - Apr-30-2020, 04:09 PM
RE: Return Multiple or one just - by ndc85430 - May-01-2020, 04:31 AM
RE: Return Multiple or one just - by buran - May-01-2020, 04:40 AM
RE: Return Multiple or one just - by JohnnyCoffee - May-01-2020, 11:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Function - Return multiple values tester_V 10 4,704 Jun-02-2021, 05:34 AM
Last Post: tester_V
  Return Object Created from Multiple Classes emerger 3 3,165 Oct-18-2018, 02:14 AM
Last Post: emerger
  Multiple "return" statements or "result" variable? WolfWayfarer 7 7,974 Jul-25-2018, 07:51 AM
Last Post: perfringo
  How to return multiple values from function in python pikkip 2 4,695 Jan-23-2017, 06:00 AM
Last Post: pikkip

Forum Jump:

User Panel Messages

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