Eof when reading the line. Помогите плиз! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Eof when reading the line. Помогите плиз!

В практическом задании со скидкой на учебу прога выдает ошибку Eof на изначально написанную строку кода, в которую вводятся данные. Нужно расчитать скидку на обучение, исходя из среднего арифметического между двумя сестрами. Код выглядит так: name = input() sem1_score = int(input()) sem2_score = int(input()) # место для вашего кода if (int(sem1_score) + int(sem2_score) / 2 >= 90 and int(sem1_score) + int(sem2_score) / 2 <= 100): print("50") elif (int(sem1_score) + int(sem2_score) / 2 >= 80 and int(sem1_score) + int(sem2_score) / 2 <= 89): print ("30") elif (int(sem1_score) + int(sem2_score) / 2 >= 70 and int(sem1_score) + int(sem2_score) / 2 <= 79 ): print ("10") else : print ("0")

19th Jan 2021, 1:23 PM
Никита Петрик
Никита Петрик - avatar
6 Answers
+ 8
It's working fine. Your inputs need to be Никита Петрик (Press Enter) 100 (Press Enter) 100 #output 50 Take a look at this lesson https://www.sololearn.com/post/664632/?ref=app
19th Jan 2021, 2:01 PM
Simba
Simba - avatar
+ 9
You can use range function instead of and operator. Also you have to close the parenthesis like this if (int(sem1_score) + int(sem2_score)) / 2 >= 90 and (int(sem1_score) + int(sem2_score)) / 2 <= 100: print("50") #your code https://code.sololearn.com/c8XCvvK9p028/?ref=app
19th Jan 2021, 1:41 PM
Simba
Simba - avatar
+ 1
Ty. I'll try it.
19th Jan 2021, 1:42 PM
Никита Петрик
Никита Петрик - avatar
0
I am not getting any eof errors but various other errors but you need to enter input as follow if it's an eof error. Name Score1 Score2 Я не получаю никаких ошибок eof, но получаю различные другие ошибки, но вам нужно ввести ввод, как показано ниже, если это ошибка eof. имя Оценка1 Оценка2
19th Jan 2021, 1:34 PM
Abhay
Abhay - avatar
0
I think that i'm understand. I'l try it. Thank you so much!)
19th Jan 2021, 1:35 PM
Никита Петрик
Никита Петрик - avatar
0
Pls, run your own code. It shows the same EOF!
19th Jan 2021, 1:47 PM
Никита Петрик
Никита Петрик - avatar