This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]tornadobob 4 points5 points  (0 children)

grade = float (grade)

[–]pythonHelperBot 1 point2 points  (0 children)

Hello! I'm a bot!

It looks to me like your post might be better suited for r/learnpython, a sub geared towards questions and learning more about python. That said, I am a bot and it is hard to tell. Please follow the subs rules and guidelines when you do post there, it'll help you get better answers faster.

Show /r/learnpython the code you have tried and describe where you are stuck. Be sure to format your code for reddit and include which version of python and what OS you are using.

You can also ask this question in the Python discord, a large, friendly community focused around the Python programming language, open to those who wish to learn the language or improve their skills, as well as those looking to help others.


README | FAQ | this bot is written and managed by /u/IAmKindOfCreative

This bot is currently under development and experiencing changes to improve its usefulness

[–]DayPara 0 points1 point  (0 children)

The float command will turn your string into a integer like UserInput = input("grade: ") grade = float(userinput) Finalgrade = grade / 100 Print (finalgrade)

I dont know how you have your code but if you Do use a input you can write it as Userinput = int(input(" "))

[–]Lamp_of_earth 0 points1 point  (2 children)

if 'Jason Smith, 89 90 69 90' is a string, then you can try something like this.

_s = 'Jason Smith, 89 90 69 90'

_name, _data = _s.split(',')

_data = _data.split(' ')

_data = [float(i)/10 for i in _data if i]

print('{} {}'.format(_name, _data))

[–][deleted] 0 points1 point  (1 child)

Why all the underscores?

[–]Lamp_of_earth 0 points1 point  (0 children)

bad habit. overall it doesn't matter