Can someone help me with that code?
Creating a program
Write a Python program as below algorithm
- Enter 3 subjects as follow (English, Maths, Computer Science)
- Change all subjects data to integers - int
- Check if English is Greater than 95 AND Computer Science is Greater than 92
Then print ("You are ASP Cluster") - Check if Maths is Greater than 90 OR Computer Science is Greater than 92
Then print ("You care CAI Cluster") - If all marks do not match conditions
Then print ("You are AE Cluster")
Voters
IMayBeMe (344)
Are you looking to find their Unicode
values cause otherwise converting a string
to an int
would be impossible. So could you please give a little bit more info on how you are planning to achieve this?
Mariamalrashdi (0)
Yeb I want to convet it to [email protected]
IMayBeMe (344)
@Mariamalrashdi You can covert it to Unicode
by using the ord()
function to find the values.
RYANTADIPARTHI (6001)
what have you tried first?
Now I could straight up give you the code, but instead here are some pointers
To take input in python, you do
That will print
Enter some data
, and then whatever you enter will be saved in the variable dataTo convert from a string to an integer we can do
So long as your
string
is a string value of a number,int()
will convert to an integer.To do
if
s in python, we doHopefully that should help, if you need any more just reply to this comment
Thank you I understand, but can you give me the code please🙏🏻@19ecal
@Mariamalrashdi Have you tried to write something with the information I gave you?
I got it somthing like that
English = input("enter English mark")
English = int(English)
Math = input("enter Math mark")
Math = int(Math)
Computer = input("enter Computer mark")
Computer = int(Computer)
if English > 95 and Computer > 92:
print("You are ASP Cluster")
elif Math > 90 or Computer > 92:
print ("You are CAI Cluster")
else:
print("You are AE Cluster")
@19ecal
@Mariamalrashdi That should work as long as you remember to indent after the
if
s like thisAlso, remember you can put you code inside 3 backticks to format it as code when you're using repl.it talk
Here's some more information about that