Sort by

recency

|

4494 Discussions

|

  • + 0 comments

    Why is this failing on number 29

    !/bin/python3

    import math import os import random import re import sys

    if name == 'main': n = int(input().strip())

    if n in range(1, 101): if n % 2==0 and n in range(6, 21): print("Weird") elif n % 2==0 and n in range(2, 6) or n > 20: print("Not Weird") elif n % 2==1: print("Weird")

  • + 0 comments

    n = int(input()) student_marks = {} for _ in range(n): data = input().split() name = data[0] scores = list(map(float, data[1:])) student_marks[name] = scores query_name = input() average_marks = sum(student_marks[query_name]) / len(student_marks[query_name])

    print(f"{average_marks:.2f}")

  • + 0 comments

    This fails on the numbers 18 and 20 in here, but runs correctly locally on python 3.12.7

    n = int(input().strip())
        if n % 2 != 0:
            message = 'Weird'
        elif n in range(2,6):
            message = 'Not Weird'
        elif n in range(6-21):
            message = 'Weird'
        else:
            message = 'Not Weird'
        print(message)
    
  • + 0 comments

    For Python3 Platform

    n = int(input())
    
    if(n % 2 != 0):
        print("Weird")
    else:
        if(2 <= n <= 5):
            print("Not Weird")
        elif(6 <= n <= 20):
            print("Weird")
        else:
            print("Not Weird")
    
  • + 0 comments

    n = int(input().strip())

    print("Not Weird" if n % 2 == 0 and (n in range(2,6) or n > 20) else "Weird")