Python Tutorial 3: Getting User Input from Keyboard

Python Tutorial 3: Getting User Input from Keyboard

Paul McWhorter

3 года назад

48,661 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@anupamhospital
@anupamhospital - 25.11.2023 19:38

Your teaching is amazing. Love you a lot.

Ответить
@user-ys6bc7yh7z
@user-ys6bc7yh7z - 24.09.2023 10:37

Thank you very much for an amazing lesson. Struggled with the assignment, but completed it nevertheless!

Ответить
@LaForgeTechnologies
@LaForgeTechnologies - 21.06.2023 05:12

Great lesson.

Ответить
@alfredcalleja450
@alfredcalleja450 - 07.06.2023 07:40

Thanks Paul, I did the Homework and it took me a while to figure out how to add the numbers instead of concatenating them but it all works fine now.

Ответить
@chalmerditmars7037
@chalmerditmars7037 - 02.06.2023 01:29

My idle shell took the input as strings so it put the two numbers back to back when I added them so I changed input to int(input(------------------)). Found this today, really enjoy lessons so far.

Ответить
@aliusef2912
@aliusef2912 - 22.05.2023 22:18

The best teacher ever

Ответить
@waltranger8160
@waltranger8160 - 08.05.2023 15:59

BOOM 7 + 2 = 9 LETS GO

Ответить
@davidschnider1297
@davidschnider1297 - 18.02.2023 00:26

I like easy lessons .. LOL .. and easy homework assignments...

Ответить
@Dheeraj4011
@Dheeraj4011 - 25.12.2022 14:07

Thanks for the content. I've written my first python program and I'm very excited for the upcoming lectures. I made an average calculator for 2 inputs today.

Ответить
@ben_shoots_
@ben_shoots_ - 28.09.2022 23:13

Ok, I'm a little proud of figuring out how to add operators to the question to get it to prompt and then use if else statements. Thanks Paul!

Ответить
@HoangVu-id2vp
@HoangVu-id2vp - 20.07.2022 23:44

Thanks!

Ответить
@adelabuidris6292
@adelabuidris6292 - 29.06.2022 00:02

First_umber = int(input( 'please input your first number '))

Second_number = int(input( ' please input your second number '))

Number = first_number + second_number

Ответить
@maureenbennett809
@maureenbennett809 - 23.06.2022 04:00

😁😁

Ответить
@mohsenr4434
@mohsenr4434 - 26.05.2022 13:35

Thank you!

Ответить
@alligator4465
@alligator4465 - 21.05.2022 18:02

I love your videos Paul! As a newbie programmer, your approach and your style is very beginner friendly and VERY enjoyable to watch. I wouldn’t mind listening to you for hours! Thanks for the great content!

Ответить
@mkalamwanyasi9204
@mkalamwanyasi9204 - 20.05.2022 15:51

Here is the exercise Teacher,
x=input("Enter the name of your Girl friend: ")

print("The name of your Girl friendis",x)
print(x,"Welcome to Python Land, Jeph loves you so much")
print("Now you are going to print the first two numbers that you like")
p=float(input("Enter the first number"))
q=float(input("Enter the second number"))
print ("The sum of",p, "and",q,"is",p+q)
print("The multiplication of",p,"and",q,"is",p*q)

Ответить
@amandawolfe4097
@amandawolfe4097 - 11.05.2022 15:31

Does Pycharm have this? I can’t find the “new file” tab and when I put “new” and then “file” it doesn’t have that I’m so confused

Ответить
@jeffreyopoku2349
@jeffreyopoku2349 - 31.03.2022 22:07

Really appreciate the effort you put into these videos. So resourceful and digestible. Much appreciated.

Ответить
@lokey2100
@lokey2100 - 28.03.2022 23:24

Thought you were a Clemson man, till I noticed the horns logo

Ответить
@charlielowell4077
@charlielowell4077 - 12.03.2022 01:03

Outstanding lesson, as expected Paul. I did the homework and, I have to admit, I had to think back to your Arduino lessons and consider variable types to complete this assignment. It took a little trial and error but I figured it out. Thanks again!

Ответить
@professorxavier9692
@professorxavier9692 - 08.03.2022 01:17

In the Python 3.9.1 Shell I downloaded, there is not an area near the top of the window that contains the "File", "Edit", "Options", "Window", "Help" sections. My shell contains only a window, which means I can't save any of the code. Do you have any ideas for troubleshooting? I have a Windows 10 OS, Asus Vivobook. I went on the Python site and downloaded multiple versions but I am somehow still having the same problem even though I currently have the latest version downloaded. Swift help would be greatly appreciated my friend!

EDIT: Nevermind, I decided to just use Pycharm for the time being

Ответить
@rockymountainfacet5958
@rockymountainfacet5958 - 25.02.2022 22:06

God Bless you Paul McWhorter. These videos you do are life changing for me. I appreciate everything you do.

Ответить
@noweare1
@noweare1 - 18.01.2022 00:57

Coming from a C background I feel like I'm skipping lots of steps programming in python. So this is what a high level lang. feels like : )

Ответить
@hughpatterson1480
@hughpatterson1480 - 30.12.2021 03:50

Great Lesson and yes, I did the homework for the next lesson, I am so glad you enforce good punctuation because not doing so makes things look unprofessional when it comes to print statements. If my students go on to create programs and then try to market those programs, no one will take them seriously if their work looks sloppy. Not using good punctuation also leads to the development of bad habits. As I tell my students, "it is much easier to develop a good habit than it is to break a bad habit." Thanks for another great lesson that will be passed on to my students!

Ответить
@Javaman92
@Javaman92 - 25.12.2021 21:28

I'm not liking Python already. I wrote a simple program to calculate how many months from an inputted age and it refuses to recognize the age as an INT but keeps putting it as a string. AGH

Ответить
@waynemunger4648
@waynemunger4648 - 01.12.2021 04:09

So I'm hoping there is a line that I can put somewhere in my program to stop it from doing that I am using the program that you wrote out in series 33

Ответить
@waynemunger4648
@waynemunger4648 - 01.12.2021 04:08

Your videos have been great help in helping me with this project this is just something that I'm trying to overcome I want to move 180 on the X axis but I don't want it to return when I put the joystick to center

Ответить
@waynemunger4648
@waynemunger4648 - 01.12.2021 04:08

Hi Paul how are you doing I am trying to program servo motors for a robot arm I'm using a spring loaded joystick an a arduino I would like to know if there is something that I can put in my program to stop the robot from returning to zero when I move the joystick back to center even if there is a time delay I can put in there so if I wanna open up my grippers I would like my grippers to stay open even when the joystick is returned to center

Ответить
@skoupidio88
@skoupidio88 - 13.11.2021 16:48

Thank you!

Ответить
@alfredcheung6704
@alfredcheung6704 - 11.11.2021 07:06

Thanks a lot Paul. Good teaching!

Ответить
@centrodoreforco-aulasderef7743
@centrodoreforco-aulasderef7743 - 11.11.2021 06:39

Thank you so much for sharing your knowledge!

Ответить
@sangeetasingh2278
@sangeetasingh2278 - 13.10.2021 16:40

A great lesson as always Paul

Ответить
@pedrocosta8922
@pedrocosta8922 - 12.10.2021 08:24

Hello, Paul! Doing the homework, I wasn't getting the desired result but I went to search for the way to get the inputs as integer or float numbers and then I got the desired result. :D Cheers!

Ответить
@karraralmukhtar
@karraralmukhtar - 03.10.2021 17:18

I just love you ❤

Ответить
@thirupathaiah2981
@thirupathaiah2981 - 01.09.2021 19:08

Python controlling machines 🤩

Ответить
@86Carrera911
@86Carrera911 - 17.08.2021 03:46

OK, so when I typed in the below, it seems as though python is treating my inputs like strings instead of numbers. In the video examples, the only items that were added together were statically set prior to adding them and printing the result. Pretty sure there's a way to tell python how to treat things, but I don't think Paul has gone over them yet.

x=input('Please input your first number:')
y=input('Please input your second number:')
z=x+y
print('The result of', x, '+', y, 'is: ',z)

Ответить
@larrytaylor7753
@larrytaylor7753 - 13.08.2021 02:55

I am in outing 2 numbers, x and y. Then coding z=x+y. If x=55 and y=66, z prints as 5566. Looks like a variable issue. Since I’m going through the AI lessons as well, I am running ver. 3.9.6. If that matters.

Ответить
@sathyaprasad2389
@sathyaprasad2389 - 04.08.2021 12:47

Thank you sir 🙏

Ответить
@dolfinmagikpro
@dolfinmagikpro - 03.08.2021 21:26

Great lesson ... Thank you!
Just curious ... Why does it add a space before and after a string?
For example, you typed (I'll type an underscore to represent spaces) "print('Hello_',_name,_'_Welcome to Python Land!')
And it returned "Hello__Paul_,_Welcome to Python Land!" Is there a way to make those extra spaces go away? Is there something besides a comma that could be used, perhaps a semi-colon that wouldn't leave those extra spaces before and after the variable?
Thanks again! As always ... Have a better day!

Ответить
@nafisahmad4968
@nafisahmad4968 - 02.08.2021 18:32

if the 'ok' button annoy you after press 'run module'. Than go to 'option' > 'configure IDLE' > 'General' > in the middle of the page 'At start of Run (F5)' section press 'No prompt'. than press 'apply' than 'ok' to solve the annoy thing

Ответить
@hassanniaz7583
@hassanniaz7583 - 02.08.2021 07:06

So basically I combined lesson 2 and 3 for this homework. Gotta say it was pretty satisfying. Here's the code :

x=[ ]
y=input('Please enter your first number: ')
z=input('Please enter your second number: ')
x.append(y)
x.append(z)
Ans=int(x[0])+int(x[1])
print('The sum of the entered numbers is = ',Ans)

Ответить
@hassanniaz7583
@hassanniaz7583 - 02.08.2021 07:01

Thank you for your efforts sir!

Ответить
@manavt2000
@manavt2000 - 01.08.2021 10:58

Thanks Mr Paul for such great lessons!

Ответить
@alexthebear
@alexthebear - 16.07.2021 22:43

Oh, i found a problem - input got string instead of number
so i had to cover int(input()) and it worked fine.

Cool .... Thanks

Ответить
@vanitakurse6982
@vanitakurse6982 - 14.07.2021 09:07

Thank you for the outstanding lessons! Your lessons have been so helpful and I greatly appreciate your time in making these videos and sharing with everyone.

Ответить
@advancedperformance9721
@advancedperformance9721 - 10.07.2021 04:37

Love it 😀

Ответить