Deutsch   English   Français   Italiano  
<p49qdk-ea6.ln1@lazy.lzy>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Piergiorgio Sartor
 <piergiorgio.sartor.this.should.not.be.used@nexgo.REMOVETHIS.de>
Newsgroups: comp.lang.python
Subject: Re: Multiplication
Date: Mon, 1 Apr 2024 10:51:05 +0200
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <p49qdk-ea6.ln1@lazy.lzy>
References: <multiplication-20240401093746@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 01 Apr 2024 08:54:45 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="5759890b231061ed942a2b90dc3178e5";
	logging-data="2528412"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/ryzTxFH6US7DUc3HuPMR0"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:I3N8vhYlbpzIzJZ0eC1AxoBMx+A=
Content-Language: it, en-GB
In-Reply-To: <multiplication-20240401093746@ram.dialup.fu-berlin.de>
Bytes: 1618

On 01/04/2024 10.40, Stefan Ram wrote:
>      Q: How can I multiply two variables in Python? I tried:
>      
> a = 2
> b = 3
> print( ab )
> 
>      but it did not work.
> 
>      A: No, this cannot work. To multiply, you need the multiplication
>      operator. You can import the multiplication operator from "math":
> 
>      Code example:
> 
> from math import *
> 
> a = 2
> b = 3
> print( a * b )

I guess the operator "*" can be imported from any module... :-)

bye,

-- 

piergiorgio