O
O
Oleg Petrov2018-10-01 16:42:08
Python
Oleg Petrov, 2018-10-01 16:42:08

Why is Print being executed 2 times?

I make code: or
print('Hi')

Import json
print('Hi')

Why is "HI" displayed 2 times in the second case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2018-10-01
@Smeilz1

Because you named the script json.py. It imports itself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question