Ask questions which are clear, concise and easy to understand.
Ask QuestionPosted by Sriram Naik 3 years, 4 months ago
- 1 answers
Sia ? 3 years, 4 months ago
an activity that is natural to or the purpose of a person or thing.
Posted by ? Royal Thakur ? 3 years, 4 months ago
- 3 answers
Sm . 3 years, 3 months ago
? Royal Thakur ? 3 years, 3 months ago
Good evening sis ...yes I know ...
... I will report him very soon ...
How are you ..?
Posted by Dinesh Gawla 3 years, 4 months ago
- 0 answers
Posted by Swati Rajesh 3 years, 4 months ago
- 0 answers
Posted by Animesh Kumar 3 years, 4 months ago
- 2 answers
Posted by Aastha Kuldeep 3 years, 4 months ago
- 1 answers
Preeti Dabral 3 years, 4 months ago
Int function is a very simple function used to convert any number into an integer value. Integer values are any number which is a whole number, but it can be a positive number or negative number.
Posted by Deepak Danu 3 years, 4 months ago
- 0 answers
Posted by Dhanush N 3 years, 4 months ago
- 0 answers
Posted by Trending Sardar'S 3 years, 4 months ago
- 0 answers
Posted by Vishwa Priya 3 years, 4 months ago
- 0 answers
Posted by Khusi Munda 3 years, 4 months ago
- 1 answers
Preeti Dabral 3 years, 4 months ago
Actually you need to create a nested dictionary with name as values and another dict as keys, in pretty way the nested dict may look like:
{
'anmol': {'chemistrymarks': 3, 'physicsmarks': 2, 'mathmarks': 1},
'uppal': {'chemistrymarks': 6, 'physicsmarks': 5, 'mathmarks': 4}
}
So you need to add the following lines to create a nested dictionary.
num_students = int(raw_input("Please enter number of students:"))
print "you entered %s students" %num_students
student_info = {}
student_data = ['Math marks : ', 'Physics marks : ', 'Chemistry marks : ']
for i in range(0,num_students):
student_name = raw_input("Name :")
student_info[student_name] = {}
for entry in student_data:
student_info[student_name][entry] = int(raw_input(entry)) #storing the marks entered as integers to perform arithmetic operations later on.
#print student_info
print"Please enter student name ?"
name = raw_input("Student name : ")
if name in student_info.keys():
print "Average student marks : ", str(sum(student_info[name].values())/3.0)
else:
print"please enter valid name"
Posted by Khusi Munda 3 years, 4 months ago
- 1 answers
Preeti Dabral 3 years, 4 months ago
schooldict ={}
no_of_class=int(input('Enter the number of classes:'))
for x in range(1,no_of_class+1):
schooldict[x] = input('Enter the teacher names:')
print("Display:")
print(schooldict)
classId=int(input('Enter class Id:'))
if classId in schooldict:
print ("teacher name: " + str(schooldict[classId]) + "\n")
Posted by Khusi Munda 3 years, 4 months ago
- 1 answers
Preeti Dabral 3 years, 4 months ago
t=tuple( )
n=int(input("enter any no.:"))
for i in range(n):
a=input("enter number:")
t+=(a,)
print(t)
for i in t:
print(i)
print(max(t))
print(min(t))
Explanation: first we have created a tuple by accepting values from the user .and we display it's elements one after the another also it will display the minimum and maximum value
Posted by Khusi Munda 3 years, 4 months ago
- 1 answers
Preeti Dabral 3 years, 4 months ago
n = int(input("Enter the number of subjects: "))
l = list()
for i in range(n):
x = float(input("Enter the marks: "))
l.append(x)
print(l, "is the given list of marks.")
print()
tot = int(input("Enter the total marks of the test: "))
ntot = n*tot
ftot = sum(l)
print("Total marks: ", ftot)
print("Percentage: ", (ftot/ntot)*100)
Posted by R Amirthesh 3 years, 5 months ago
- 1 answers
Preeti Dabral 3 years, 5 months ago
Parameters refers to the list of variables in a method declaration. Arguments are the actual values that are passed in when the method is invoked. When you invoke a method, the arguments used must match the declaration's parameters in type and order.
Posted by ? Royal Thakur ? 3 years, 5 months ago
- 1 answers
Ritika Agrawal 3 years, 5 months ago
Posted by Khusi Munda 3 years, 5 months ago
- 1 answers
Preeti Dabral 3 years, 5 months ago
lst=eval(input(“Enter list:”))
length=len(lst)
mean=sum=0
for i in range(0,length):
sum+=lst[i]
mean=sum/length
print(“Given list is:”,lst)
print(“The mean of the given list is:”,mean)
Posted by Abhishek Kumar 3 years, 5 months ago
- 2 answers
Preeti Dabral 3 years, 5 months ago
A Lambda Function in Python programming is an anonymous function or a function having no name. It is a small and restricted function having no more than one line. To do so, you will use the lambda keyword (just as you use def to define normal functions).
Posted by Bhesaj Nayak 3 years, 5 months ago
- 0 answers
Posted by Daljeet Kumar 3 years, 5 months ago
- 0 answers
Posted by Suvangi Mohanty 3 years, 5 months ago
- 3 answers
Posted by ? Royal Thakur ? 3 years, 5 months ago
- 3 answers
Posted by Suvangi Mohanty 3 years, 5 months ago
- 0 answers
Posted by Ankesh Phalswal 3 years, 5 months ago
- 0 answers
Posted by Alan Joy 3 years, 5 months ago
- 0 answers
Posted by Nancy Mishra 3 years, 5 months ago
- 1 answers
Rashmi Raj 3 years, 5 months ago
myCBSEguide
Trusted by 1 Crore+ Students
Test Generator
Create papers online. It's FREE.
CUET Mock Tests
75,000+ questions to practice only on myCBSEguide app
🦋Tejasvi Singh🦋 3 years, 3 months ago
1Thank You