how can I use this character (*) repeatedly in python3?

3

example:

a=**********
print'a'

It shows me the following error

OUTPUT:
Traceback (most recent call last):
  File "python", line 1
    a=**********
       ^
SyntaxError: invalid syntax
    
asked by juan 03.10.2018 в 04:45
source

2 answers

1

The idea is correct however in Python 3 you must use

  • in function print parantesis () to achieve print the desired value
  • In addition to that

  • the other error is that you declare a variable a but when you use it in print you put it in quotation marks and that is incorrect because when you put it so 'a' you are telling it to print a text string that is worth to
  • In addition to that

  • the asterisks should be put in quotation marks, because being a character would be interpreted in a wrong way because for example * is the symbol to represent the multiplication operator
  • Thus, it will be functional

    a= "**********"
    print(a)
    

    Final result

        
    answered by 03.10.2018 в 04:49
    0

    try like this, the characters * are reserved so you have to use them as text.

    a='**********'
    print(a)
    
        
    answered by 03.10.2018 в 05:12