File tree Expand file tree Collapse file tree 5 files changed +5
-5
lines changed Expand file tree Collapse file tree 5 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- # Create a program that writes "Hello world!" on the screen.
1+ # 01- Create a program that writes "Hello world!" on the screen.
22print ('\033 [1;32;40m Hello, world!\033 [m' )
Original file line number Diff line number Diff line change 1- # Create a program that asks for the user's name and writes a welcome message.
1+ #02- Create a program that asks for the user's name and writes a welcome message.
22name = input ('What is your name:' )
33print (f'Nice meet you, { name } !' )
Original file line number Diff line number Diff line change 1- # Create a program that reads two numbers and displays the sum between them.
1+ #03- Create a program that reads two numbers and displays the sum between them.
22first_number = int (input ('Enter a number:' ))
33second_number = int (input ('Enter another number:' ))
44print (f'The sum of { first_number } + { second_number } is equal to { first_number + second_number } .' )
Original file line number Diff line number Diff line change 1- # Write a program that reads something from the keyboard and shows its primitive type and all the
1+ #04- Write a program that reads something from the keyboard and shows its primitive type and all the
22# possible information about him.
33value = input ('Type something:' )
44print ('The primitive type of this value is:' , type (value ))
Original file line number Diff line number Diff line change 1- # Write a program that reads an integer and displays its successor and predecessor on the screen.
1+ #05 Write a program that reads an integer and displays its successor and predecessor on the screen.
22number = int (input ('Enter a number:' ))
33print (f' If the number is \033 [35m{ number } \033 [m,its predecessor is \033 [31m{ (number - 1 )} \033 [m and his successor is \033 [32m{ (number + 1 )} \033 [m.' )
You can’t perform that action at this time.
0 commit comments