import os

# a = open(r'C:\Users\User\Desktop\basiq py\fruits.txt', 'a')
# a.write(' apple, orange.')
# a.close()
# a = open(r'C:\Users\User\Desktop\basiq py\fruits.txt', 'r')
# print(a.read())

# v = open(r'C:\Users\User\Desktop\basiq py\5strings.txt', 'r')
# a = v.readline()
# b = v.readline()
# c = v.readline()
# d = v.readline()
# e = v.readline()
# print(a + b + c + d + e)

# a = open(r"C:\Users\User\Desktop\basiq py\pr3.txt", 'r')
# v = ''
# for word in a:
#     if v < word:
#         v = word
# print(v)

# a = open(r'C:\Users\User\Desktop\basiq py\groupnames.txt', 'r')
# a = a.read()
#
# a = a.split(' ')
#
# for word in a:
#     print(len(word) * (word + ' '))

# new_names = ['Ани', 'Армен', 'Арен', 'Аргишти', 'Арсен', 'Алик', 'Анаит', 'Анна']
# for name in new_names:
#     fg = name
#   if os.path.exists(name):
#       print('true')
#   else:
#       print("foals")

# s = 'D d D D D d D D F G g g g H h j'
# for x in s:
#     print(x.isupper())

# v = "Homework 6Deadline: 28 AUG, 20:00 Problem 1Create a file manually with some text in it like 'My favourite
# fruits " \ "are:'.Then write a program to append the file with the fruits that you love. Problem 2Create a file
# that has 5 or " \ "more lines of text.Write a program to store each line in a variable. Problem 3Find the longest
# word in the file " \ "pr3.txt. Problem 4Create a list of names of all our group members.Loop over the list and
# create files (filename = " \ "name).Each file should contain the name of a person repeated as many times as the
# characters of the name.for " \ "example: file -> Ani.txt              text - > Ani                       Ani
# AniAni is " \ "repeated 3 times as it has 3 characters. Problem 5After writing Problem 4 write a function that gets
# this list " \ "and checks if files with these names exist. If a file exists return True, otherwise False.'new_names
# = ['Ani', " \ "'Armen', 'Aren', 'Argishti', 'Arsen', 'Alik', 'Anahit', 'Anna']' Problem 6Write a function that gets
# a file path " \ "and calculates how many upper case letters are in the text.Hint: use isupper() method. Problem 7 (
# OPTIONAL)Write " \ "a program to show the frequency(how many times a word appears in the text) of each word. Hint:
# set() " a = len(v) c = v.replace("Problem", "") b = a - len(c) n = b / len("problem") print(n)
