Rearrange the code to print "Welcome" if the script is imported, and "Hi" if it is not imported. print("Welcome") else: p | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Rearrange the code to print "Welcome" if the script is imported, and "Hi" if it is not imported. print("Welcome") else: p

Answer me this question guys..

6th Apr 2020, 4:32 PM
Raj Kumar.c
 Raj Kumar.c - avatar
5 Answers
+ 2
if __name__== "__main__": print("Hi") else: print("Welcome") This is the correct answer
19th Apr 2020, 2:27 PM
Prasad Mutkule
Prasad Mutkule - avatar
0
Hmmm
15th Apr 2020, 5:54 PM
Egbo Emmanuelhills
Egbo Emmanuelhills - avatar
0
if __name__== "__main__": print("Hi") else: print("Welcome")
26th May 2021, 8:37 PM
Hayder Jawad Al-ATBEE
Hayder Jawad Al-ATBEE - avatar
0
Answer is ``` if __name__== "__main__": print("Hi") else: print("Welcome") ```
16th Aug 2022, 6:29 AM
Iman Jafari
Iman Jafari - avatar
- 1
Post the code
15th Apr 2020, 5:54 PM
Egbo Emmanuelhills
Egbo Emmanuelhills - avatar