# Class 11 - Informatics Practices - Python Snippets (Set-2)

Write Python Programs for the following problem statements:

1. Write a program in python to input marks in 5 subjects from the user and display the average marks.

2. Write a program in python to read details like name, class, age of a student and then print the details firstly in same line and then in separate lines.

3. Write a program in python to input a number and print its first five multiples.

4. Write a program to read a number n and print n, n² , n³ and n⁴

5. Write a program that generates the following output: 5 @ 10 @ 9

Snippet 1: Write a program in python to input marks in 5 subjects from the user and display the average marks.

```# Write a program in python to input marks in 5 subjects
# from the user and display the average marks.

print("Enter marks out of 50 for the following subjects:")
sub1 = int(input("Maths:"))
sub2 = int(input("English:"))
sub3 = int(input("Pol Science:"))
sub4 = int(input("Geography:"))
sub5 = int(input("Informatics:"))
avg = (sub1 + sub2 + sub3 + sub4 + sub5)/5

```

Program output:

Snippet 2
Write a program in python to read details like name, class, age of a student and then print the details firstly in same line and then in separate lines.

```# python snippet 2 by eduvictors.com
# Write a program in python to read details like name,
# class, age of a student and then print the details firstly in
# same line and then in separate lines.

stud_name = input("Enter you name:")
stud_age = int(input("Enter your age in years:"))

print(stud_name, stud_class, stud_age)
print("Student Name:", stud_name)
print("Student Class:", stud_class)
print("Student Age:", stud_age)
```

Output:

```# Snippet 3 by eduvictors.com
# Write a program in python to input a number and print
# its first five multiples.

n = int(input("Enter an integer: "))
print("First five multiples of", n, "are")
print(n, n * 2, n * 3, n * 4, n * 5)
```

Output:

Snippet 4: Write a program to read a number n and print n, n² , n³ and n⁴

```# Snippet 4 by eduvictors.com
# Write a program to read a number n and print n, n² , n³ and n⁴

n = int(input("Enter an integer: "))
print(n, n ** 2, n ** 3, n ** 4)
```

Output:

Snippet 5Write a program that generates the following output: 5 @ 10 @ 9

```# Snippet 5 by eduvictors.com
# Write a program that generates the following output:
# 5 @ 10 @9

n = 5
print(n, n * 2, n * 2 - 1, sep=' @ ')
```

Output:
{"ft_lang_label":"__label__en","ft_lang_prob":0.7213178,"math_prob":0.8609612,"size":3896,"snap":"2023-40-2023-50","text_gpt3_token_len":1049,"char_repetition_ratio":0.168037,"word_repetition_ratio":0.5381232,"special_character_ratio":0.2859343,"punctuation_ratio":0.109266944,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9778359,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,3,null,6,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-08T02:50:30Z\",\"WARC-Record-ID\":\"<urn:uuid:83412d97-bb55-4642-8526-554abee4eb92>\",\"Content-Length\":\"151339\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b53c9fd0-d7e7-406f-8666-8a6472c96fbd>\",\"WARC-Concurrent-To\":\"<urn:uuid:b46fa576-4b19-401d-b28a-4199584ac8d2>\",\"WARC-IP-Address\":\"142.251.163.121\",\"WARC-Target-URI\":\"https://cbse.eduvictors.com/2022/09/class-11-informatics-practices-python.html\",\"WARC-Payload-Digest\":\"sha1:Y4RPE5INC5J4EGTUXNY4GKKWLL7QPIYY\",\"WARC-Block-Digest\":\"sha1:H3ZZ2QA5YPZKUEXJLGBZD77E7X5IUQ52\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100710.22_warc_CC-MAIN-20231208013411-20231208043411-00042.warc.gz\"}"}