Python Assignment 1

Dear all, I hope you all have received the first assignemnt. I would request everyone to complete the assignemnt and submit it by Saturday. Use this thread to ask any questions if you have.

@chalapakaramakrishna41422 @anuj9620029081659 @pavithrasuji3157526 @shwetahemaswati17967 @karthikjohnson1790532 @jhachandani8169654 @anithathampy36963840 @vjkit4219280

i have a problem in question no.22

Sure, let me know the issue

how make compare which is greater i .had written this code

number =int(input(“enter the number”))
if a > b:
print (“a is greater”)
else:
print (“b is greater”)

This looks correct, only you need to take care of the indentation. Otherwise the code is correct

the error which i get is
number =int(input(“enter the number”))
if a > b:
print (“a is greater”)
else:
print (“b is greater”)

ValueError                                Traceback (most recent call last)

[/tmp/ipykernel_1074/1334999706.py](https://localhost:8080/#) in <cell line: 0>()
----> 1 number =int(input("enter the number"))
      2 if a > b:
      3   print ("a is greater")
      4 else:
      5   print ("b is greater")

ValueError: invalid literal for int() with base 10: 'b'

What’s the input that you have entered? Also, you have taken the input in a variable named ‘number’, however you are comparing two different variables. What’s inside a and b? Did you take any inputs there?

ok got it ,i change the variable to the specific number then it run without error .

i have few questions:
1.How many functions are available in Dictionary / what functions can we use in Dictionay?
i found one, update()

Nice question. There are a lot of functions a dictionary supports. Rather than listing all of them, throughout the course we will be discussing the practicle examples. However, you can go through the official documentation: 5. Data Structures — Python 3.14.6 documentation

Hi Amit,

Please find my assignment 1 pdf attached.

Regards,
Vijay Krishna
8008001956

(Attachment J_Vijay_Krishna_Assignment 1 Submission.pdf is missing)

Please submit it through form that has been shared with you

Hi Amit,

The form is asking to provide the google drive link where the assignment is submitted or uploaded. However i do not have permissions to upload in the mentioned google drive link.

Please suggest.

Regards,
Vijay

question no.27
how to do

3rd and 4th part of the question

That’s the assignment :slight_smile:

Let’s say if you have taken input for “Salary”. Suppose the input is Rs 1000, then 10% of Rs 1000 would be Rs 100, so updated salary would be 1100. That’s what you need to do via programming