Output | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Output

How is possible traslate "no output" in " " ? Or better the code has to write nothing

26th Feb 2021, 12:46 PM
Giuseppe Noce
Giuseppe Noce - avatar
11 Answers
+ 2
print() will only insert a newline
26th Feb 2021, 12:54 PM
Abhay
Abhay - avatar
+ 2
Remove the else statement if you don't want any output
26th Feb 2021, 1:11 PM
Abhay
Abhay - avatar
+ 1
Can you show your code ,inputs and expected output?
26th Feb 2021, 1:04 PM
Abhay
Abhay - avatar
+ 1
If the requirement is to not output anything if the condition is false, just don't do the opposite, so delete the else branch
26th Feb 2021, 1:55 PM
Benjamin Jürgens
Benjamin Jürgens - avatar
0
Thank you but no your solution is not good .. the code writes "No output" and it is not correct for the examinator unluckly
26th Feb 2021, 1:01 PM
Giuseppe Noce
Giuseppe Noce - avatar
0
Sing
26th Feb 2021, 1:01 PM
Giuseppe Noce
Giuseppe Noce - avatar
0
My code purity = float(input()) if 91.7 < purity < 99.9: print("Accepted") else: print ()
26th Feb 2021, 1:05 PM
Giuseppe Noce
Giuseppe Noce - avatar
0
Do not output anything is the expected output
26th Feb 2021, 1:08 PM
Giuseppe Noce
Giuseppe Noce - avatar
0
Sorry but it is the same... the code writes no output and the examinator says no good .... very sad
26th Feb 2021, 1:15 PM
Giuseppe Noce
Giuseppe Noce - avatar
0
Thanks friends but ... unfortunately I followed your advises but the requirement is not get .. Why ?
26th Feb 2021, 3:53 PM
Giuseppe Noce
Giuseppe Noce - avatar
0
This works purity = float(input()) if 99.9 <= purity <= 100: print ('Accepted') if 91.7 <= purity <99.9: print ('Accepted')
27th Feb 2021, 8:42 AM
Giuseppe Noce
Giuseppe Noce - avatar