Weak Type Ability for Python

2QdxY4RzWzUUiLuE at potatochowder.com 2QdxY4RzWzUUiLuE at potatochowder.com
Wed Apr 12 15:17:17 EDT 2023


On 2023-04-12 at 14:51:44 -0400,
Thomas Passin <list1 at tompassin.net> wrote:

> On 4/12/2023 1:11 PM, Chris Angelico wrote:
> > On Thu, 13 Apr 2023 at 03:05, Ali Mohseni Roodbari
> > <ali.mohseniroodbari at gmail.com> wrote:
> > > 
> > > Hi all,
> > > Please make this command for Python (if possible):
> > > 
> > > > > > x=1
> > > > > > y='a'
> > > > > > wprint (x+y)
> > > > > > 1a
> > > 
> > > In fact make a new type of print command which can print and show strings
> > > and integers together.
> > > 
> > 
> > Try:
> > 
> > print(x, y)
> > 
> > ChrisA
> 
> It puts a space between "1" and "a", whereas the question does not want the
> space.  print(f'{x}{y}') would do it, but only works for variables named "x"
> and "y".

Or possibly print(x, y, sep='').

> As happens so often, the OP has not specified what he actually wants to do
> so we can only answer the very specific question.

Agreed.


More information about the Python-list mailing list