I am a first year computer science student struggling with Python!

I am a first year computer science student struggling with Python!
0
#1

i desperately need help with the following problems. For the first picture I have no idea what i am doing. and for the 2nd picture I am struggling to output the values of 0 as well as just finshing the code without any errors.

0 Likes

#2

What have you tried so far?

Edit

I’m only seeing one picture, btw

0 Likes

#3

I haven’t tried anything as far as I have no idea how to start it. I don’t even know how to create a range. could you give me any tips. The picture is asking you to write a program which will print the first 20 numbers that are multiples of 13.

0 Likes

#5

I have worked it out now my friend.

for i in range(20): print(13*i+13)

0 Likes

#6
One way to write it is having a for loop iterate through a list and multiply each number by 13. 
twenty = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]

for num in twenty:
    num*=13
    print(num)


A better way to do the problem is with the range function.

for num in range(1,21):
    num*=13
    print(num)
0 Likes

#7

good that you are thinking to learn this language! it is really god and very usefull i will suggest you to really have proper command on it ass your senior !

0 Likes