worked, Ty dude ^>
not working, help, im using this code-
t=int(input())
for a in range (0,t):
n=int(input())
s=0
for temp in [int(x) for x in input().split()]:
s=s+temp
print(s)
custom input working all fine but throwing this error without custom input-
Traceback (most recent call last):
File â./prog.pyâ, line 1, in
EOFError: EOF when reading a line
but this will execute every codeâŚno matter what we have writtenâŚbecause it means if my code has any error then just passâŚand thatâs why it will not show errorâŚafter doing this it says âsuccessfully executedâ but this doesnât mean our code is correct and giving the desired outputâŚeven if you write a song instead of your code it will get executed successfully.
wowwww!! this worksâŚ
Try this trick:
try:
//-----Your Code-----
//----Your Code-----
//âYour Code-------
except:
print() #Donât Pass
import sys
arr = list(map(int, sys.stdin.readline().rstrip().split()))
this should work fine
try using try and except
eg:
try:
# your code here
# try giving input here
except:
pass
Thanks so much dude!! It really worked!
n=int(input())
for i in range(n):
a,b= map(int, input().split())
sum=a+b
print(sum,"\n")
it is not working anyone please help me
Why put "\n"
again when print
will automatically add a new line at the end?
It does not working
Code is here
try:
x = input(âWhat is your nameâ)
print(x)
except:
pass
In output only print the line âWhat is your nameâ. It canât take input from user
Write your input on the section âCustom Inputâ and then click âRunâ.
Can u plz share the codechef link for this questions i might have an alternative solution