I took a course in C++ and now I'm trying to practice some python after watching all of Bucky's videos on youtube. To practice I've been recreating C++ assignments into python but I'm having a little trouble with this one. It requires that you take 5 numbers that the user inputs and returns the average, only I dont know how to take in multiple values at once. Here is what that part of the assignment looks like in C++:
float num1, num2, num3, num4, num5, total, average;
/*First prompt the user to enter five numbers.*/
cout<<"Please enter five numbers."<<endl;
can this be recreated in Python?
accepting multiple user input
Post a Reply
|Oldest Newest Rating|
Otto Von Chesterfield
· August 17, 2015
I'm not exactly sure what you want, since I'm not all too familiar with the C family, but I have a rough idea.
If the user inputs five numbers at a time, do this:
Tell me if this helps!
This section is all about snakes! Just kidding.
|Bucky Roberts Administrator|