Please help me, Python hyungs

Asked 2 years ago, Updated 2 years ago, 41 views

The first question

Question number 2

It hasn't been long since I started Python, but it's not working out at all. Help me!

python list

2022-09-20 10:51

1 Answers

l1 = ['I like', 'I love']
l2 = ['fan cake', 'kiwi juice', 'espresso']

for front in l1:
    for back in l2:
        print(front, back)

You can access elements in the list in the form for in.

arr = []
print('Enter 5 numbers :')
for _ in range(5):
    arr.append(int(input()))

print('Hap:', sum(arr))
print('Average:', sum(arr)/len(arr))
print('Max:', max(arr))
print('Min: ', min(arr))

You can also use the method given in the problem.

I would like you to study more about the list data type :D


2022-09-20 10:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.