-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPython_Problems.py
More file actions
108 lines (100 loc) · 2.71 KB
/
Python_Problems.py
File metadata and controls
108 lines (100 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Program to display age critiera
a = input("Enter Age:")
a = int(a)
if(a > 18):
print("You are eligible")
elif(a < 18):
print("You are not eligible")
else :
print("Take Pations")
# Program to display higest number from four enterd numbers
a = int(input("Enter first number\n"))
b = int(input("Enter second number\n"))
c = int(input("Enter third number\n"))
d = int(input("Enter fourth number\n"))
if(a > b):
print("Greater number is:",a)
elif(b > c):
print("Greater number is:",b)
elif(c > d):
print("Greater number is:", c)
else:
print("Greater number is :",d)
'''Program to display total marks of student with three
subject and passing critarea is 40% '''
import math
a = int(input("Enter marks of Maths:"))
b = int(input("Enter marks of physics:"))
c = int(input("Enter marks of chemistry:"))
total = a + b + c
percentage = total / 300
final = percentage * 100
if(final >= 40):
print("Student is pass")
elif( final == 33):
print("Student get grees")
else:
print("Student is Failed")
'''Progrm to illstrate the following string contain 10 charcter or less
than 10 character '''
str10 = input("Enter any string: ")
if(len(str10) <=10):
print("This is valid String ")
else :
print("This is not valid String")
# Check the spam of perticular comment
text = input("Enter your Text:")
if("make lot of money" in text): # "in" is keyword
spam = True
elif("click this" in text):
spam = True
elif("subscribe this" in text):
spam = True
else:
spam = False
if(spam == True):
print("Text is Spam")
else:
print("Text is not Spam")
# Check that given name by user is present in list or not
lis = ["raj","vikas","rahul","ankur","rohan"]
take = input("Enter Names: ")
if take in lis :
print("You are right given name in the list")
else:
print("You are wrong because given name is not in list")
#Program to display grades behalf of marks
take = int(input("Enter your marks: "))
if take >= 90:
grade = "A+"
elif take >= 80:
grade = "A"
elif take >= 70:
grade = "B"
elif take >= 60:
grade = "C"
elif take >= 50:
grade ="D"
else :
grade ="F"
print("You get "+ grade)
# Check the given post has name 'raj' or not
name = input("Enter search:\t")
if ("RAJ" in name):
print("You are right")
elif ("Raj" in name):
print("You are right")
elif ("RAj" in name):
print("You are right")
elif ("raj" in name):
print("You are right")
elif ("rAJ" in name):
print("You are right")
elif ("raJ" in name):
print("You are right")
elif ("rAj" in name):
print("You are right")
elif ("RaJ" in name):
print("You are right")
else :
print("You are wrong ")